chore: remove stale workaround in collect() (#1078)

The issue in question, https://github.com/denoland/deno_std/issues/1310,
has been marked complete. Looks like the underlying issue has been
fixed. So this just removes the comment/unnecessary code.

---------

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
This commit is contained in:
Geoff Flarity
2023-05-27 17:44:35 +10:00
committed by GitHub
co-authored by Asher Gomez
parent e0cb693c0f
commit 41a75fe1f5
2 changed files with 2 additions and 12 deletions
+1 -6
View File
@@ -40,11 +40,6 @@ export async function collect(directory: string): Promise<Manifest> {
const routes = [];
try {
const routesUrl = toFileUrl(routesDir);
// TODO(lucacasonato): remove the extranious Deno.readDir when
// https://github.com/denoland/deno_std/issues/1310 is fixed.
for await (const _ of Deno.readDir(routesDir)) {
// do nothing
}
const routesFolder = walk(routesDir, {
includeDirs: false,
includeFiles: true,
@@ -59,7 +54,7 @@ export async function collect(directory: string): Promise<Manifest> {
}
}
} catch (err) {
if (err instanceof Deno.errors.NotFound) {
if (err.cause instanceof Deno.errors.NotFound) {
// Do nothing.
} else {
throw err;
+1 -6
View File
@@ -249,11 +249,6 @@ export class ServerContext {
opts.staticDir ?? "./static",
manifest.baseUrl,
);
// TODO(lucacasonato): remove the extranious Deno.readDir when
// https://github.com/denoland/deno_std/issues/1310 is fixed.
for await (const _ of Deno.readDir(fromFileUrl(staticFolder))) {
// do nothing
}
const entires = walk(fromFileUrl(staticFolder), {
includeFiles: true,
includeDirs: false,
@@ -284,7 +279,7 @@ export class ServerContext {
staticFiles.push(staticFile);
}
} catch (err) {
if (err instanceof Deno.errors.NotFound) {
if (err.cause instanceof Deno.errors.NotFound) {
// Do nothing.
} else {
throw err;