mirror of
https://github.com/denoland/deno.git
synced 2024-11-25 15:29:32 -05:00
docs(cli/dts): use one code block per truncate example (#10494)
This commit is contained in:
parent
89b61b5d05
commit
820c658ff8
1 changed files with 4 additions and 0 deletions
4
cli/dts/lib.deno.ns.d.ts
vendored
4
cli/dts/lib.deno.ns.d.ts
vendored
|
@ -2365,7 +2365,9 @@ declare namespace Deno {
|
|||
* // truncate the entire file
|
||||
* const file = Deno.openSync("my_file.txt", { read: true, write: true, truncate: true, create: true });
|
||||
* Deno.ftruncateSync(file.rid);
|
||||
* ```
|
||||
*
|
||||
* ```ts
|
||||
* // truncate part of the file
|
||||
* const file = Deno.openSync("my_file.txt", { read: true, write: true, create: true });
|
||||
* Deno.writeSync(file.rid, new TextEncoder().encode("Hello World"));
|
||||
|
@ -2391,7 +2393,9 @@ declare namespace Deno {
|
|||
* // truncate the entire file
|
||||
* const file = Deno.open("my_file.txt", { read: true, write: true, create: true });
|
||||
* await Deno.ftruncate(file.rid);
|
||||
* ```
|
||||
*
|
||||
* ```ts
|
||||
* // truncate part of the file
|
||||
* const file = Deno.open("my_file.txt", { read: true, write: true, create: true });
|
||||
* await Deno.write(file.rid, new TextEncoder().encode("Hello World"));
|
||||
|
|
Loading…
Reference in a new issue