0
0
mirror of https://github.com/honojs/hono.git synced 2024-11-21 18:18:57 +01:00

refactor(timing/utils-body): a few minor edits (#3557)

* upd

* upd

* upd

* upd

* Add files via upload
This commit is contained in:
shray sharma 2024-10-31 03:50:41 +01:00 committed by GitHub
parent caeecf99a8
commit fea5947ea2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 9 deletions

View File

@ -75,13 +75,11 @@ const getTime = (): number => {
*/ */
export const timing = (config?: TimingOptions): MiddlewareHandler => { export const timing = (config?: TimingOptions): MiddlewareHandler => {
const options: TimingOptions = { const options: TimingOptions = {
...{ total: true,
total: true, enabled: true,
enabled: true, totalDescription: 'Total Response Time',
totalDescription: 'Total Response Time', autoEnd: true,
autoEnd: true, crossOrigin: false,
crossOrigin: false,
},
...config, ...config,
} }
return async function timing(c, next) { return async function timing(c, next) {

View File

@ -5,10 +5,10 @@
import { HonoRequest } from '../request' import { HonoRequest } from '../request'
type BodyDataValueDot = { [x: string]: string | File | BodyDataValueDot } & {} type BodyDataValueDot = { [x: string]: string | File | BodyDataValueDot }
type BodyDataValueDotAll = { type BodyDataValueDotAll = {
[x: string]: string | File | (string | File)[] | BodyDataValueDotAll [x: string]: string | File | (string | File)[] | BodyDataValueDotAll
} & {} }
type SimplifyBodyData<T> = { type SimplifyBodyData<T> = {
[K in keyof T]: string | File | (string | File)[] | BodyDataValueDotAll extends T[K] [K in keyof T]: string | File | (string | File)[] | BodyDataValueDotAll extends T[K]
? string | File | (string | File)[] | BodyDataValueDotAll ? string | File | (string | File)[] | BodyDataValueDotAll