diff options
Diffstat (limited to 'cli/js/files.ts')
-rw-r--r-- | cli/js/files.ts | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/cli/js/files.ts b/cli/js/files.ts index b9da1363f..99ae19879 100644 --- a/cli/js/files.ts +++ b/cli/js/files.ts @@ -22,43 +22,47 @@ import { } from "./ops/fs/open.ts"; export { OpenOptions, OpenMode } from "./ops/fs/open.ts"; -export function openSync(path: string, mode?: OpenOptions): File; -export function openSync(path: string, mode?: OpenMode): File; +export function openSync(path: string, options?: OpenOptions): File; +export function openSync(path: string, openMode?: OpenMode): File; + +/**@internal*/ export function openSync( path: string, modeOrOptions: OpenOptions | OpenMode = "r" ): File { - let mode = undefined; + let openMode = undefined; let options = undefined; if (typeof modeOrOptions === "string") { - mode = modeOrOptions; + openMode = modeOrOptions; } else { checkOpenOptions(modeOrOptions); options = modeOrOptions as OpenOptions; } - const rid = opOpenSync(path, mode as OpenMode, options); + const rid = opOpenSync(path, openMode as OpenMode, options); return new File(rid); } export async function open(path: string, options?: OpenOptions): Promise<File>; -export async function open(path: string, mode?: OpenMode): Promise<File>; +export async function open(path: string, openMode?: OpenMode): Promise<File>; + +/**@internal*/ export async function open( path: string, modeOrOptions: OpenOptions | OpenMode = "r" ): Promise<File> { - let mode = undefined; + let openMode = undefined; let options = undefined; if (typeof modeOrOptions === "string") { - mode = modeOrOptions; + openMode = modeOrOptions; } else { checkOpenOptions(modeOrOptions); options = modeOrOptions as OpenOptions; } - const rid = await opOpen(path, mode as OpenMode, options); + const rid = await opOpen(path, openMode as OpenMode, options); return new File(rid); } |