From 3f5c7254351756f342c5eb31ebc831f74707cb3d Mon Sep 17 00:00:00 2001 From: Yusuke Wada Date: Sun, 10 Jul 2022 18:50:36 +0900 Subject: [PATCH] chore: denoify --- deno_dist/context.ts | 3 +-- deno_dist/hono.ts | 2 +- deno_dist/middleware/serve-static/serve-static.ts | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/deno_dist/context.ts b/deno_dist/context.ts index 95d6d64c..1f1891e8 100644 --- a/deno_dist/context.ts +++ b/deno_dist/context.ts @@ -4,8 +4,7 @@ import { isAbsoluteURL } from './utils/url.ts' type Headers = Record export type Data = string | ArrayBuffer | ReadableStream - -export type Env = Record +type Env = Record export class Context { req: Request diff --git a/deno_dist/hono.ts b/deno_dist/hono.ts index 6d36b55d..634e59a1 100644 --- a/deno_dist/hono.ts +++ b/deno_dist/hono.ts @@ -1,12 +1,12 @@ import { compose } from './compose.ts' import { Context } from './context.ts' -import type { Env } from './context.ts' import { extendRequestPrototype } from './request.ts' import type { Router } from './router.ts' import { METHOD_NAME_ALL, METHOD_NAME_ALL_LOWERCASE } from './router.ts' import { TrieRouter } from './router/trie-router/index.ts' // Default Router import { getPathFromURL, mergePath } from './utils/url.ts' +type Env = Record export type Handler = ( c: Context, next: Next diff --git a/deno_dist/middleware/serve-static/serve-static.ts b/deno_dist/middleware/serve-static/serve-static.ts index d475137f..2fa4649b 100644 --- a/deno_dist/middleware/serve-static/serve-static.ts +++ b/deno_dist/middleware/serve-static/serve-static.ts @@ -1,4 +1,4 @@ -import type { Context, Env } from '../../context.ts' +import type { Context } from '../../context.ts' import type { Handler, Next } from '../../hono.ts' import { getContentFromKVAsset } from '../../utils/cloudflare.ts' import { getFilePath } from '../../utils/filepath.ts' @@ -14,7 +14,7 @@ export type ServeStaticOptions = { const DEFAULT_DOCUMENT = 'index.html' // This middleware is available only on Cloudflare Workers. -export const serveStatic = (options: ServeStaticOptions = { root: '' }): Handler => { +export const serveStatic = (options: ServeStaticOptions = { root: '' }): Handler => { return async (c: Context, next: Next): Promise => { // Do nothing if Response is already set if (c.res && c.finalized) {