diff options
author | dubiousjim <dubiousjim@gmail.com> | 2020-03-06 08:34:02 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-06 08:34:02 -0500 |
commit | 9a63902db5bc33f3130c7227299cfb3b5be400ae (patch) | |
tree | 2d8215f1e153d5ca20ff608973a1988c589eaa58 /std/http/file_server.ts | |
parent | afea9b2edd4becf66bdc6d40a0cb0dbe29267524 (diff) |
Rename readDir -> readdir (#4225)
Diffstat (limited to 'std/http/file_server.ts')
-rwxr-xr-x | std/http/file_server.ts | 6 |
1 files changed, 3 insertions, 3 deletions
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<Response> { 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 ?? ""); |