Skip to content

Commit 44e2ae3

Browse files
fix: incorrect file check
1 parent b6907e6 commit 44e2ae3

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/fs_routes.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ export interface FsRouteFile<State> {
3636

3737
// deno-lint-ignore no-explicit-any
3838
function isFreshFile<State>(mod: any): mod is FreshFsMod<State> {
39-
return mod !== null && typeof mod === "object" &&
40-
typeof mod.default === "function" ||
39+
if (mod === null || typeof mod !== "object") return false;
40+
41+
return typeof mod.default === "function" ||
4142
typeof mod.config === "object" || typeof mod.handlers === "object" ||
4243
typeof mod.handlers === "function" || typeof mod.handler === "object" ||
4344
typeof mod.handler === "function";

0 commit comments

Comments
 (0)