Skip to content

Commit

Permalink
fix(zod-openapi): add Promise<void> to Hook
Browse files Browse the repository at this point in the history
  • Loading branch information
taku-hatano committed May 10, 2024
1 parent b0c94cd commit 8ca9709
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/zod-openapi/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,13 @@ export type Hook<T, E extends Env, P extends string, O> = (
error: ZodError
},
c: Context<E, P>
) => TypedResponse<O> | Promise<TypedResponse<T>> | Response | Promise<Response> | void
) =>
| TypedResponse<O>
| Promise<TypedResponse<T>>
| Response
| Promise<Response>
| void
| Promise<void>

type ConvertPathType<T extends string> = T extends `${infer Start}/{${infer Param}}${infer Rest}`
? `${Start}/:${Param}${ConvertPathType<Rest>}`
Expand Down

0 comments on commit 8ca9709

Please sign in to comment.