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:
co-authored by
Asher Gomez
parent
e0cb693c0f
commit
41a75fe1f5
+1
-6
@@ -40,11 +40,6 @@ export async function collect(directory: string): Promise<Manifest> {
|
|||||||
const routes = [];
|
const routes = [];
|
||||||
try {
|
try {
|
||||||
const routesUrl = toFileUrl(routesDir);
|
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, {
|
const routesFolder = walk(routesDir, {
|
||||||
includeDirs: false,
|
includeDirs: false,
|
||||||
includeFiles: true,
|
includeFiles: true,
|
||||||
@@ -59,7 +54,7 @@ export async function collect(directory: string): Promise<Manifest> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err instanceof Deno.errors.NotFound) {
|
if (err.cause instanceof Deno.errors.NotFound) {
|
||||||
// Do nothing.
|
// Do nothing.
|
||||||
} else {
|
} else {
|
||||||
throw err;
|
throw err;
|
||||||
|
|||||||
@@ -249,11 +249,6 @@ export class ServerContext {
|
|||||||
opts.staticDir ?? "./static",
|
opts.staticDir ?? "./static",
|
||||||
manifest.baseUrl,
|
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), {
|
const entires = walk(fromFileUrl(staticFolder), {
|
||||||
includeFiles: true,
|
includeFiles: true,
|
||||||
includeDirs: false,
|
includeDirs: false,
|
||||||
@@ -284,7 +279,7 @@ export class ServerContext {
|
|||||||
staticFiles.push(staticFile);
|
staticFiles.push(staticFile);
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err instanceof Deno.errors.NotFound) {
|
if (err.cause instanceof Deno.errors.NotFound) {
|
||||||
// Do nothing.
|
// Do nothing.
|
||||||
} else {
|
} else {
|
||||||
throw err;
|
throw err;
|
||||||
|
|||||||
Reference in New Issue
Block a user