diff --git a/src/adapter/deno/serve-static.ts b/src/adapter/deno/serve-static.ts index 81772f66d..b037466b6 100644 --- a/src/adapter/deno/serve-static.ts +++ b/src/adapter/deno/serve-static.ts @@ -11,14 +11,13 @@ export const serveStatic = ( ): MiddlewareHandler => { return async function serveStatic(c, next) { const getContent = async (path: string) => { - // eslint-disable-next-line @typescript-eslint/no-explicit-any - let file: any try { - file = await open(path) + const file = await open(path) + // eslint-disable-next-line @typescript-eslint/no-explicit-any + return file ? (file.readable as any) : null } catch (e) { console.warn(`${e}`) } - return file ? file.readable : null } const pathResolve = (path: string) => { return `./${path}`