Skip to content
Myr

refactor(timing): don't use `Partial` for the options (#2712)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

* refactor(timing): dont' use `Partial` for the options * denoify

authored by Yusuke Wada · committed by GitHub · parent d87d996 · Browse files · 2 files+12 added−12 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+12 added−12 removed

  • other:+12 added−12 removed

2 files+12 added−12 removed

modified:deno_dist/middleware/timing/index.ts+6 added-6 removed
modified:src/middleware/timing/index.ts+6 added-6 removed
15 unmodified lines
16 start: number17}1819interface TimingOptions {20 total: boolean21 enabled: boolean | ((c: Context) => boolean)22 totalDescription: string23 autoEnd: boolean24 crossOrigin: boolean | string | ((c: Context) => boolean | string)20 total?: boolean21 enabled?: boolean | ((c: Context) => boolean)22 totalDescription?: string23 autoEnd?: boolean24 crossOrigin?: boolean | string | ((c: Context) => boolean | string)25}2627const getTime = (): number => {28 try {
1 unmodified line
30 } catch {}31 return Date.now()32}3334export const timing = (config?: Partial<TimingOptions>): MiddlewareHandler => {34export const timing = (config?: TimingOptions): MiddlewareHandler => {35 const options: TimingOptions = {36 ...{37 total: true,38 enabled: true,
101 unmodified lines