diff options
author | dubiousjim <dubiousjim@gmail.com> | 2020-03-06 11:29:23 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-06 11:29:23 -0500 |
commit | acf0958e940f8c668c9f34dc780da48d8963a1e7 (patch) | |
tree | 69816ce683e0b369e2c7b6566cc249255a39953d /cli/js/truncate.ts | |
parent | bb3d9c8280912f6e30692477aeb5331fb359d993 (diff) |
Rename name/filename arguments to path (#4227)
There's a lot of variation in doc comments and internal code about
whether the first parameter to file system calls is `path` or `name` or
`filename`. For consistency, have made it always be `path`.
Diffstat (limited to 'cli/js/truncate.ts')
-rw-r--r-- | cli/js/truncate.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cli/js/truncate.ts b/cli/js/truncate.ts index d784b3614..15143479f 100644 --- a/cli/js/truncate.ts +++ b/cli/js/truncate.ts @@ -19,8 +19,8 @@ function coerceLen(len?: number): number { * Deno.truncateSync("hello.txt", 10); * * Requires `allow-write` permission. */ -export function truncateSync(name: string, len?: number): void { - sendSync("op_truncate", { name, len: coerceLen(len) }); +export function truncateSync(path: string, len?: number): void { + sendSync("op_truncate", { path, len: coerceLen(len) }); } /** Truncates or extends the specified file, to reach the specified `len`. @@ -28,6 +28,6 @@ export function truncateSync(name: string, len?: number): void { * 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) }); +export async function truncate(path: string, len?: number): Promise<void> { + await sendAsync("op_truncate", { path, len: coerceLen(len) }); } |