diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2019-03-10 04:30:38 +1100 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2019-03-09 12:30:38 -0500 |
commit | 034e2cc02829c9244b32232074c7a48af827a2fb (patch) | |
tree | bade01606a1ee076c1f753ce99c97ddb1e4edf30 /js/read_dir.ts | |
parent | 8c7a12d1b258f0ef5ab27f49c424331d43e8d97f (diff) |
Migrate from tslint to eslint for linting (#1905)
Diffstat (limited to 'js/read_dir.ts')
-rw-r--r-- | js/read_dir.ts | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/js/read_dir.ts b/js/read_dir.ts index d7d20644b..2515a61c6 100644 --- a/js/read_dir.ts +++ b/js/read_dir.ts @@ -5,23 +5,6 @@ import * as dispatch from "./dispatch"; import { FileInfo, FileInfoImpl } from "./file_info"; import { assert } from "./util"; -/** Reads the directory given by path and returns a list of file info - * synchronously. - * - * const files = Deno.readDirSync("/"); - */ -export function readDirSync(path: string): FileInfo[] { - return res(dispatch.sendSync(...req(path))); -} - -/** Reads the directory given by path and returns a list of file info. - * - * const files = await Deno.readDir("/"); - */ -export async function readDir(path: string): Promise<FileInfo[]> { - return res(await dispatch.sendAsync(...req(path))); -} - function req(path: string): [flatbuffers.Builder, msg.Any, flatbuffers.Offset] { const builder = flatbuffers.createBuilder(); const path_ = builder.createString(path); @@ -42,3 +25,20 @@ function res(baseRes: null | msg.Base): FileInfo[] { } return fileInfos; } + +/** Reads the directory given by path and returns a list of file info + * synchronously. + * + * const files = Deno.readDirSync("/"); + */ +export function readDirSync(path: string): FileInfo[] { + return res(dispatch.sendSync(...req(path))); +} + +/** Reads the directory given by path and returns a list of file info. + * + * const files = await Deno.readDir("/"); + */ +export async function readDir(path: string): Promise<FileInfo[]> { + return res(await dispatch.sendAsync(...req(path))); +} |