mirror of
https://github.com/denoland/deno.git
synced 2025-09-27 04:39:10 +00:00
Cleanup comments and internal variables (#4205)
This commit is contained in:
parent
809019dc6e
commit
6cd46fa3ef
25 changed files with 681 additions and 572 deletions
|
@ -13,21 +13,21 @@ function coerceLen(len?: number): number {
|
|||
return len;
|
||||
}
|
||||
|
||||
/** Truncates or extends the specified file synchronously, updating the size of
|
||||
* this file to become size.
|
||||
/** Synchronously truncates or extends the specified file, to reach the
|
||||
* specified `len`.
|
||||
*
|
||||
* Deno.truncateSync("hello.txt", 10);
|
||||
*/
|
||||
*
|
||||
* Requires `allow-write` permission. */
|
||||
export function truncateSync(name: string, len?: number): void {
|
||||
sendSync("op_truncate", { name, len: coerceLen(len) });
|
||||
}
|
||||
|
||||
/**
|
||||
* Truncates or extends the specified file, updating the size of this file to
|
||||
* become size.
|
||||
/** Truncates or extends the specified file, to reach the specified `len`.
|
||||
*
|
||||
* await Deno.truncate("hello.txt", 10);
|
||||
*/
|
||||
*
|
||||
* Requires `allow-write` permission. */
|
||||
export async function truncate(name: string, len?: number): Promise<void> {
|
||||
await sendAsync("op_truncate", { name, len: coerceLen(len) });
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue