fix(valibot-validator): fix Hook type (#105)

* fix(valibot-validator): fix Hook type

* changeset
pull/106/head
Yusuke Wada 2023-08-07 18:39:39 +09:00 committed by GitHub
parent 1fb2ab1dad
commit c783e0943a
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/valibot-validator': patch
---
fix a Hook type

View File

@ -6,7 +6,7 @@ import { safeParse } from 'valibot'
type Hook<T, E extends Env, P extends string> = ( type Hook<T, E extends Env, P extends string> = (
result: { success: true; data: T } | { success: false; error: ValiError }, result: { success: true; data: T } | { success: false; error: ValiError },
c: Context<E, P> c: Context<E, P>
) => Response | Promise<Response> | void ) => Response | Promise<Response> | void | Promise<Response | void>
export const vValidator = < export const vValidator = <
T extends BaseSchema, T extends BaseSchema,