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/read_file.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/read_file.ts')
-rw-r--r-- | cli/js/read_file.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cli/js/read_file.ts b/cli/js/read_file.ts index 31b0348e6..43372ca45 100644 --- a/cli/js/read_file.ts +++ b/cli/js/read_file.ts @@ -9,8 +9,8 @@ import { readAll, readAllSync } from "./buffer.ts"; * console.log(decoder.decode(data)); * * Requires `allow-read` permission. */ -export function readFileSync(filename: string): Uint8Array { - const file = openSync(filename); +export function readFileSync(path: string): Uint8Array { + const file = openSync(path); const contents = readAllSync(file); file.close(); return contents; @@ -23,8 +23,8 @@ export function readFileSync(filename: string): Uint8Array { * console.log(decoder.decode(data)); * * Requires `allow-read` permission. */ -export async function readFile(filename: string): Promise<Uint8Array> { - const file = await open(filename); +export async function readFile(path: string): Promise<Uint8Array> { + const file = await open(path); const contents = await readAll(file); file.close(); return contents; |