summaryrefslogtreecommitdiff
path: root/cli/js/truncate.ts
diff options
context:
space:
mode:
authordubiousjim <dubiousjim@gmail.com>2020-03-02 10:19:42 -0500
committerGitHub <noreply@github.com>2020-03-02 10:19:42 -0500
commit6cd46fa3ef4b12f35a60f1a33c7f038c06b5fc71 (patch)
treee8ef21a936ebac529a7c8e87681123fbd225ff5f /cli/js/truncate.ts
parent809019dc6e9a80843affc927fa7a52cd41e76471 (diff)
Cleanup comments and internal variables (#4205)
Diffstat (limited to 'cli/js/truncate.ts')
-rw-r--r--cli/js/truncate.ts14
1 files changed, 7 insertions, 7 deletions
diff --git a/cli/js/truncate.ts b/cli/js/truncate.ts
index 17c08674c..d784b3614 100644
--- a/cli/js/truncate.ts
+++ b/cli/js/truncate.ts
@@ -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) });
}