fix(zod-validator): fixed zod-validator hook types (#119)

* fix(zod-validator): fixed zod-validator hook types

* changeset
pull/120/head
Yusuke Wada 2023-08-19 02:36:55 +09:00 committed by GitHub
parent 28ff7e4bbd
commit 3b37eb4aef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 8 deletions

View File

@ -0,0 +1,5 @@
---
'@hono/zod-validator': patch
---
fix(zod-validator): fixed zod-validator hook types

View File

@ -5,14 +5,7 @@ import type { z, ZodSchema, ZodError } from 'zod'
export type Hook<T, E extends Env, P extends string, O = {}> = (
result: { success: true; data: T } | { success: false; error: ZodError; data: T },
c: Context<E, P>
) =>
| Response
| Promise<Response>
| void
| Promise<Response | void>
| TypedResponse<O>
| Promise<TypedResponse<O>>
| Promise<TypedResponse<O> | void>
) => Response | Promise<Response> | void | Promise<Response | void> | TypedResponse<O>
export const zValidator = <
T extends ZodSchema,