From bc792c02674cc22459a3016b271f9c5b70e9d573 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Wed, 29 Apr 2020 16:39:37 -0400 Subject: make camel case readDir, readLink, realPath (#4995) --- cli/js/ops/fs/read_dir.ts | 4 ++-- cli/js/ops/fs/read_link.ts | 4 ++-- cli/js/ops/fs/real_path.ts | 10 ++++++++++ cli/js/ops/fs/realpath.ts | 10 ---------- 4 files changed, 14 insertions(+), 14 deletions(-) create mode 100644 cli/js/ops/fs/real_path.ts delete mode 100644 cli/js/ops/fs/realpath.ts (limited to 'cli/js/ops/fs') diff --git a/cli/js/ops/fs/read_dir.ts b/cli/js/ops/fs/read_dir.ts index 7d65fed48..1e8d79edc 100644 --- a/cli/js/ops/fs/read_dir.ts +++ b/cli/js/ops/fs/read_dir.ts @@ -16,11 +16,11 @@ function res(response: ReadDirResponse): DirEntry[] { return response.entries; } -export function readdirSync(path: string): Iterable { +export function readDirSync(path: string): Iterable { return res(sendSync("op_read_dir", { path }))[Symbol.iterator](); } -export function readdir(path: string): AsyncIterable { +export function readDir(path: string): AsyncIterable { const array = sendAsync("op_read_dir", { path }).then(res); return { async *[Symbol.asyncIterator](): AsyncIterableIterator { diff --git a/cli/js/ops/fs/read_link.ts b/cli/js/ops/fs/read_link.ts index 4ac8db3db..bcd27ccb7 100644 --- a/cli/js/ops/fs/read_link.ts +++ b/cli/js/ops/fs/read_link.ts @@ -1,10 +1,10 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. import { sendSync, sendAsync } from "../dispatch_json.ts"; -export function readlinkSync(path: string): string { +export function readLinkSync(path: string): string { return sendSync("op_read_link", { path }); } -export function readlink(path: string): Promise { +export function readLink(path: string): Promise { return sendAsync("op_read_link", { path }); } diff --git a/cli/js/ops/fs/real_path.ts b/cli/js/ops/fs/real_path.ts new file mode 100644 index 000000000..ab95b9583 --- /dev/null +++ b/cli/js/ops/fs/real_path.ts @@ -0,0 +1,10 @@ +// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. +import { sendSync, sendAsync } from "../dispatch_json.ts"; + +export function realPathSync(path: string): string { + return sendSync("op_realpath", { path }); +} + +export function realPath(path: string): Promise { + return sendAsync("op_realpath", { path }); +} diff --git a/cli/js/ops/fs/realpath.ts b/cli/js/ops/fs/realpath.ts deleted file mode 100644 index e8a904079..000000000 --- a/cli/js/ops/fs/realpath.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -import { sendSync, sendAsync } from "../dispatch_json.ts"; - -export function realpathSync(path: string): string { - return sendSync("op_realpath", { path }); -} - -export function realpath(path: string): Promise { - return sendAsync("op_realpath", { path }); -} -- cgit v1.2.3