feat: deprecate Deno.write() and Deno.writeSync() (#22064)

For removal in Deno v2.
This commit is contained in:
Asher Gomez 2024-01-25 02:36:13 +11:00 committed by GitHub
parent 50eaeabefb
commit a5a973e93c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 31 additions and 11 deletions

View file

@ -140,8 +140,22 @@ const denoNs = {
);
return io.readSync(rid, buffer);
},
write: io.write,
writeSync: io.writeSync,
write(rid, data) {
internals.warnOnDeprecatedApi(
"Deno.write()",
new Error().stack,
"Use `writer.write()` instead.",
);
return io.write(rid, data);
},
writeSync(rid, data) {
internals.warnOnDeprecatedApi(
"Deno.writeSync()",
new Error().stack,
"Use `writer.writeSync()` instead.",
);
return io.writeSync(rid, data);
},
File: fs.File,
FsFile,
open: fs.open,