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/stat.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/stat.ts')
-rw-r--r-- | cli/js/stat.ts | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/cli/js/stat.ts b/cli/js/stat.ts index ea4ab1014..fa49953fb 100644 --- a/cli/js/stat.ts +++ b/cli/js/stat.ts @@ -23,61 +23,61 @@ export interface StatResponse { blocks: number; } -/** Resolves to a `Deno.FileInfo` for the specified path. If path is a +/** Resolves to a `Deno.FileInfo` for the specified `path`. If `path` is a * symlink, information for the symlink will be returned. * * const fileInfo = await Deno.lstat("hello.txt"); * assert(fileInfo.isFile()); * * Requires `allow-read` permission. */ -export async function lstat(filename: string): Promise<FileInfo> { +export async function lstat(path: string): Promise<FileInfo> { const res = (await sendAsync("op_stat", { - filename, + path, lstat: true })) as StatResponse; return new FileInfoImpl(res); } -/** Synchronously returns a `Deno.FileInfo` for the specified path. If - * path is a symlink, information for the symlink will be returned. +/** Synchronously returns a `Deno.FileInfo` for the specified `path`. If + * `path` is a symlink, information for the symlink will be returned. * * const fileInfo = Deno.lstatSync("hello.txt"); * assert(fileInfo.isFile()); * * Requires `allow-read` permission. */ -export function lstatSync(filename: string): FileInfo { +export function lstatSync(path: string): FileInfo { const res = sendSync("op_stat", { - filename, + path, lstat: true }) as StatResponse; return new FileInfoImpl(res); } -/** Resolves to a `Deno.FileInfo` for the specified path. Will always follow - * symlinks. +/** Resolves to a `Deno.FileInfo` for the specified `path`. Will always + * follow symlinks. * * const fileInfo = await Deno.stat("hello.txt"); * assert(fileInfo.isFile()); * * Requires `allow-read` permission. */ -export async function stat(filename: string): Promise<FileInfo> { +export async function stat(path: string): Promise<FileInfo> { const res = (await sendAsync("op_stat", { - filename, + path, lstat: false })) as StatResponse; return new FileInfoImpl(res); } -/** Synchronously returns a `Deno.FileInfo` for the specified path. Will +/** Synchronously returns a `Deno.FileInfo` for the specified `path`. Will * always follow symlinks. * * const fileInfo = Deno.statSync("hello.txt"); * assert(fileInfo.isFile()); * * Requires `allow-read` permission. */ -export function statSync(filename: string): FileInfo { +export function statSync(path: string): FileInfo { const res = sendSync("op_stat", { - filename, + path, lstat: false }) as StatResponse; return new FileInfoImpl(res); |