fix(zod-validator): fix a Hook type (#104)
* fix(zod-validator): fix Hook type * changesetpull/106/head
parent
b78e8e1bf4
commit
1fb2ab1dad
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'@hono/zod-validator': patch
|
||||
---
|
||||
|
||||
fix a Hook type
|
|
@ -5,7 +5,7 @@ import type { z, ZodSchema, ZodError } from 'zod'
|
|||
type Hook<T, E extends Env, P extends string> = (
|
||||
result: { success: true; data: T } | { success: false; error: ZodError },
|
||||
c: Context<E, P>
|
||||
) => Response | Promise<Response> | void
|
||||
) => Response | Promise<Response> | void | Promise<Response | void>
|
||||
|
||||
export const zValidator = <
|
||||
T extends ZodSchema,
|
||||
|
|
Loading…
Reference in New Issue