From fea5947ea25f186913e9c1e9756fc9ce80429b9f Mon Sep 17 00:00:00 2001 From: shray sharma Date: Thu, 31 Oct 2024 03:50:41 +0100 Subject: [PATCH] refactor(timing/utils-body): a few minor edits (#3557) * upd * upd * upd * upd * Add files via upload --- src/middleware/timing/timing.ts | 12 +++++------- src/utils/body.ts | 4 ++-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/middleware/timing/timing.ts b/src/middleware/timing/timing.ts index d387f43b..90d3ac1b 100644 --- a/src/middleware/timing/timing.ts +++ b/src/middleware/timing/timing.ts @@ -75,13 +75,11 @@ const getTime = (): number => { */ export const timing = (config?: TimingOptions): MiddlewareHandler => { const options: TimingOptions = { - ...{ - total: true, - enabled: true, - totalDescription: 'Total Response Time', - autoEnd: true, - crossOrigin: false, - }, + total: true, + enabled: true, + totalDescription: 'Total Response Time', + autoEnd: true, + crossOrigin: false, ...config, } return async function timing(c, next) { diff --git a/src/utils/body.ts b/src/utils/body.ts index 81fff6a8..de94080c 100644 --- a/src/utils/body.ts +++ b/src/utils/body.ts @@ -5,10 +5,10 @@ import { HonoRequest } from '../request' -type BodyDataValueDot = { [x: string]: string | File | BodyDataValueDot } & {} +type BodyDataValueDot = { [x: string]: string | File | BodyDataValueDot } type BodyDataValueDotAll = { [x: string]: string | File | (string | File)[] | BodyDataValueDotAll -} & {} +} type SimplifyBodyData = { [K in keyof T]: string | File | (string | File)[] | BodyDataValueDotAll extends T[K] ? string | File | (string | File)[] | BodyDataValueDotAll