From 9a63902db5bc33f3130c7227299cfb3b5be400ae Mon Sep 17 00:00:00 2001 From: dubiousjim Date: Fri, 6 Mar 2020 08:34:02 -0500 Subject: Rename readDir -> readdir (#4225) --- std/http/file_server.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'std/http') diff --git a/std/http/file_server.ts b/std/http/file_server.ts index e1fe14fcf..28eaef44d 100755 --- a/std/http/file_server.ts +++ b/std/http/file_server.ts @@ -6,7 +6,7 @@ // TODO Add tests like these: // https://github.com/indexzero/http-server/blob/master/test/http-server-test.js -const { args, stat, readDir, open, exit } = Deno; +const { args, stat, readdir, open, exit } = Deno; import { posix } from "../path/mod.ts"; import { listenAndServe, ServerRequest, Response } from "./server.ts"; import { parse } from "../flags/mod.ts"; @@ -113,14 +113,14 @@ async function serveFile( return res; } -// TODO: simplify this after deno.stat and deno.readDir are fixed +// TODO: simplify this after deno.stat and deno.readdir are fixed async function serveDir( req: ServerRequest, dirPath: string ): Promise { const dirUrl = `/${posix.relative(target, dirPath)}`; const listEntry: EntryInfo[] = []; - const fileInfos = await readDir(dirPath); + const fileInfos = await readdir(dirPath); for (const fileInfo of fileInfos) { const filePath = posix.join(dirPath, fileInfo.name ?? ""); const fileUrl = posix.join(dirUrl, fileInfo.name ?? ""); -- cgit v1.2.3