fix(zod-validator): fix a Hook type (#104)

* fix(zod-validator): fix Hook type

* changeset
pull/106/head
Yusuke Wada 2023-08-07 18:39:29 +09:00 committed by GitHub
parent b78e8e1bf4
commit 1fb2ab1dad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
'@hono/zod-validator': patch
---
fix a Hook type

View File

@ -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,