From b7d72fd6dcb073354b598bc28392c1c7fff65e5f Mon Sep 17 00:00:00 2001 From: Yusuke Wada Date: Sat, 18 May 2024 19:05:01 +0900 Subject: [PATCH] refactor(timing): don't use `Partial` for the options (#2712) * refactor(timing): dont' use `Partial` for the options * denoify --- deno_dist/middleware/timing/index.ts | 12 ++++++------ src/middleware/timing/index.ts | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/deno_dist/middleware/timing/index.ts b/deno_dist/middleware/timing/index.ts index 3881f8ce4..d2c4641f6 100644 --- a/deno_dist/middleware/timing/index.ts +++ b/deno_dist/middleware/timing/index.ts @@ -17,11 +17,11 @@ interface Timer { } interface TimingOptions { - total: boolean - enabled: boolean | ((c: Context) => boolean) - totalDescription: string - autoEnd: boolean - crossOrigin: boolean | string | ((c: Context) => boolean | string) + total?: boolean + enabled?: boolean | ((c: Context) => boolean) + totalDescription?: string + autoEnd?: boolean + crossOrigin?: boolean | string | ((c: Context) => boolean | string) } const getTime = (): number => { @@ -31,7 +31,7 @@ const getTime = (): number => { return Date.now() } -export const timing = (config?: Partial): MiddlewareHandler => { +export const timing = (config?: TimingOptions): MiddlewareHandler => { const options: TimingOptions = { ...{ total: true, diff --git a/src/middleware/timing/index.ts b/src/middleware/timing/index.ts index 2675b9e5b..9d6c6f1d0 100644 --- a/src/middleware/timing/index.ts +++ b/src/middleware/timing/index.ts @@ -17,11 +17,11 @@ interface Timer { } interface TimingOptions { - total: boolean - enabled: boolean | ((c: Context) => boolean) - totalDescription: string - autoEnd: boolean - crossOrigin: boolean | string | ((c: Context) => boolean | string) + total?: boolean + enabled?: boolean | ((c: Context) => boolean) + totalDescription?: string + autoEnd?: boolean + crossOrigin?: boolean | string | ((c: Context) => boolean | string) } const getTime = (): number => { @@ -31,7 +31,7 @@ const getTime = (): number => { return Date.now() } -export const timing = (config?: Partial): MiddlewareHandler => { +export const timing = (config?: TimingOptions): MiddlewareHandler => { const options: TimingOptions = { ...{ total: true,