chore(ext/io): remove use of deprecated Deno.writeSync() (#22872)

This commit is contained in:
Asher Gomez 2024-03-21 04:39:25 +11:00 committed by GitHub
parent d66154d42a
commit 9593cf2852
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 8 additions and 8 deletions

View File

@ -55,7 +55,7 @@ Deno.bench("b64_rt_short", { n: 1e6 }, () => {
const dataChunk = new Uint8Array(100);
const file = Deno.openSync("/dev/null", { write: true });
Deno.bench("write_null", { n: 5e5 }, () => {
Deno.writeSync(file.rid, dataChunk);
file.writeSync(dataChunk);
});
}

View File

@ -2141,7 +2141,7 @@ declare namespace Deno {
* "hello.txt",
* { read: true, write: true, truncate: true, create: true },
* );
* Deno.writeSync(file.rid, new TextEncoder().encode("Hello world"));
* file.writeSync(new TextEncoder().encode("Hello world"));
*
* // advance cursor 6 bytes
* const cursorPosition = Deno.seekSync(file.rid, 6, Deno.SeekMode.Start);
@ -2159,7 +2159,7 @@ declare namespace Deno {
* "hello.txt",
* { read: true, write: true, truncate: true, create: true },
* );
* Deno.writeSync(file.rid, new TextEncoder().encode("Hello world"));
* file.writeSync(new TextEncoder().encode("Hello world"));
*
* // Seek 6 bytes from the start of the file
* console.log(Deno.seekSync(file.rid, 6, Deno.SeekMode.Start)); // "6"
@ -2209,7 +2209,7 @@ declare namespace Deno {
* "my_file.txt",
* { read: true, write: true, create: true },
* );
* Deno.writeSync(file.rid, new TextEncoder().encode("Hello World"));
* file.writeSync(new TextEncoder().encode("Hello World"));
* file.truncateSync(1);
* Deno.fsyncSync(file.rid);
* console.log(Deno.readTextFileSync("my_file.txt")); // H
@ -2244,7 +2244,7 @@ declare namespace Deno {
* "my_file.txt",
* { read: true, write: true, create: true },
* );
* Deno.writeSync(file.rid, new TextEncoder().encode("Hello World"));
* file.writeSync(new TextEncoder().encode("Hello World"));
* Deno.fdatasyncSync(file.rid);
* console.log(Deno.readTextFileSync("my_file.txt")); // Hello World
* ```
@ -5471,7 +5471,7 @@ declare namespace Deno {
* "my_file.txt",
* { read: true, write: true, create: true }
* );
* Deno.writeSync(file.rid, new TextEncoder().encode("Hello World"));
* file.writeSync(new TextEncoder().encode("Hello World"));
* Deno.ftruncateSync(file.rid, 7);
* Deno.seekSync(file.rid, 0, Deno.SeekMode.Start);
* const data = new Uint8Array(32);

View File

@ -11,7 +11,7 @@ Deno.test(
create: true,
});
const data = new Uint8Array(64);
Deno.writeSync(file.rid, data);
file.writeSync(data);
Deno.fdatasyncSync(file.rid);
Deno.removeSync(filename);
},

View File

@ -46,7 +46,7 @@ Deno.test({
create: true,
});
const data = new Uint8Array(64);
Deno.writeSync(file.rid, data);
file.writeSync(data);
try {
fdatasyncSync(file.rid);