From 6cd46fa3ef4b12f35a60f1a33c7f038c06b5fc71 Mon Sep 17 00:00:00 2001 From: dubiousjim Date: Mon, 2 Mar 2020 10:19:42 -0500 Subject: Cleanup comments and internal variables (#4205) --- cli/js/read_dir.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'cli/js/read_dir.ts') diff --git a/cli/js/read_dir.ts b/cli/js/read_dir.ts index 948bad044..43223e015 100644 --- a/cli/js/read_dir.ts +++ b/cli/js/read_dir.ts @@ -15,19 +15,23 @@ function res(response: ReadDirResponse): FileInfo[] { ); } -/** Reads the directory given by path and returns a list of file info - * synchronously. +/** Synchronously reads the directory given by `path` and returns an array of + * `Deno.FileInfo`. * * const files = Deno.readDirSync("/"); - */ + * + * Requires `allow-read` permission. */ export function readDirSync(path: string): FileInfo[] { return res(sendSync("op_read_dir", { path })); } -/** Reads the directory given by path and returns a list of file info. +/** UNSTABLE: Maybe need to return an `AsyncIterable`. + * + * Reads the directory given by `path` and resolves to an array of `Deno.FileInfo`. * * const files = await Deno.readDir("/"); - */ + * + * Requires `allow-read` permission. */ export async function readDir(path: string): Promise { return res(await sendAsync("op_read_dir", { path })); } -- cgit v1.2.3