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:
parent
caeecf99a8
commit
fea5947ea2
@ -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) {
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user