From 034e2cc02829c9244b32232074c7a48af827a2fb Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Sun, 10 Mar 2019 04:30:38 +1100 Subject: Migrate from tslint to eslint for linting (#1905) --- js/read_dir.ts | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'js/read_dir.ts') 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 { - 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 { + return res(await dispatch.sendAsync(...req(path))); +} -- cgit v1.2.3