From acf0958e940f8c668c9f34dc780da48d8963a1e7 Mon Sep 17 00:00:00 2001 From: dubiousjim Date: Fri, 6 Mar 2020 11:29:23 -0500 Subject: 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`. --- cli/js/truncate.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cli/js/truncate.ts') 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 { - await sendAsync("op_truncate", { name, len: coerceLen(len) }); +export async function truncate(path: string, len?: number): Promise { + await sendAsync("op_truncate", { path, len: coerceLen(len) }); } -- cgit v1.2.3