mirror of
https://github.com/denoland/deno.git
synced 2025-09-30 06:04:48 +00:00
Cleanup comments and internal variables (#4205)
This commit is contained in:
parent
809019dc6e
commit
6cd46fa3ef
25 changed files with 681 additions and 572 deletions
|
@ -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<FileInfo[]> {
|
||||
return res(await sendAsync("op_read_dir", { path }));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue