mirror of
https://github.com/honojs/hono.git
synced 2024-12-01 11:51:01 +01:00
fix(type): add missing S to RemoveBlankRecord (#1354)
* fix(type): add missing S to RemoveBlankRecord * fix(test): Fix testcase mistake * run prettier
This commit is contained in:
parent
8adc8c14c4
commit
4a027474f1
@ -123,7 +123,7 @@ export interface HandlerInterface<
|
||||
O = {}
|
||||
>(
|
||||
...handlers: Handler<E, P, I, O>[]
|
||||
): Hono<E, RemoveBlankRecord<Schema<M, P, I['in'], O>>, BasePath>
|
||||
): Hono<E, RemoveBlankRecord<S | Schema<M, P, I['in'], O>>, BasePath>
|
||||
|
||||
//// app.get(path, ...handlers[])
|
||||
|
||||
@ -430,7 +430,7 @@ export type UndefinedIfHavingQuestion<T> = T extends `${infer _}?` ? string | un
|
||||
////// //////
|
||||
////////////////////////////////////////
|
||||
|
||||
export type ExtractSchema<T> = T extends Hono<infer _, infer S, any> ? S : never
|
||||
export type ExtractSchema<T> = UnionToIntersection<T extends Hono<infer _, infer S, any> ? S : never>
|
||||
|
||||
////////////////////////////////////////
|
||||
////// //////
|
||||
|
@ -205,6 +205,19 @@ describe('HandlerInterface', () => {
|
||||
output: {}
|
||||
}
|
||||
}
|
||||
} & {
|
||||
'/foo/:foo/books/:id': {
|
||||
$post: {
|
||||
input: {
|
||||
param: {
|
||||
id: string
|
||||
} & {
|
||||
foo: string
|
||||
}
|
||||
}
|
||||
output: {}
|
||||
}
|
||||
}
|
||||
}
|
||||
type verify = Expect<Equal<Expected, Actual>>
|
||||
})
|
||||
|
@ -123,7 +123,7 @@ export interface HandlerInterface<
|
||||
O = {}
|
||||
>(
|
||||
...handlers: Handler<E, P, I, O>[]
|
||||
): Hono<E, RemoveBlankRecord<Schema<M, P, I['in'], O>>, BasePath>
|
||||
): Hono<E, RemoveBlankRecord<S | Schema<M, P, I['in'], O>>, BasePath>
|
||||
|
||||
//// app.get(path, ...handlers[])
|
||||
|
||||
@ -430,7 +430,9 @@ export type UndefinedIfHavingQuestion<T> = T extends `${infer _}?` ? string | un
|
||||
////// //////
|
||||
////////////////////////////////////////
|
||||
|
||||
export type ExtractSchema<T> = T extends Hono<infer _, infer S, any> ? S : never
|
||||
export type ExtractSchema<T> = UnionToIntersection<
|
||||
T extends Hono<infer _, infer S, any> ? S : never
|
||||
>
|
||||
|
||||
////////////////////////////////////////
|
||||
////// //////
|
||||
|
Loading…
Reference in New Issue
Block a user