/
opt
/
canhelp
/
node_modules
/
@hono
/
zod-validator
/
dist
/
/opt/canhelp/node_modules/@hono/zod-validator/dist
mkdir
upload
Name
Size
Mode
Actions
index.cjs
2185
0644
edit
dl
rm
index.d.cts
1263
0644
edit
dl
rm
index.d.ts
1263
0644
edit
dl
rm
index.js
1142
0644
edit
dl
rm
Edit:
/opt/canhelp/node_modules/@hono/zod-validator/dist/index.d.cts
(1263B)
import { Env, ValidationTargets, Context, TypedResponse, Input, MiddlewareHandler } from 'hono'; import { ZodError, ZodSchema, z } from 'zod'; type Hook<T, E extends Env, P extends string, Target extends keyof ValidationTargets = keyof ValidationTargets, O = {}> = (result: ({ success: true; data: T; } | { success: false; error: ZodError; data: T; }) & { target: Target; }, c: Context<E, P>) => Response | void | TypedResponse<O> | Promise<Response | void | TypedResponse<O>>; type HasUndefined<T> = undefined extends T ? true : false; declare const zValidator: <T extends ZodSchema<any, z.ZodTypeDef, any>, Target extends keyof ValidationTargets, E extends Env, P extends string, In = z.input<T>, Out = z.output<T>, I extends Input = { in: HasUndefined<In> extends true ? { [K in Target]?: (In extends ValidationTargets[K] ? In : { [K2 in keyof In]?: ValidationTargets[K][K2] | undefined; }) | undefined; } : { [K_1 in Target]: In extends ValidationTargets[K_1] ? In : { [K2_1 in keyof In]: ValidationTargets[K_1][K2_1]; }; }; out: { [K_2 in Target]: Out; }; }, V extends I = I>(target: Target, schema: T, hook?: Hook<z.TypeOf<T>, E, P, Target, {}> | undefined) => MiddlewareHandler<E, P, V>; export { type Hook, zValidator };
Save
cmd:
run