Wraps a Zod schema into a ParseFn for use with vereda's parse option. Uses parseAsync, so schemas with async refinements/transforms work too.
parse
parseAsync
const UserSchema = z.object({ id: z.number(), name: z.string() });const ticket = client.get('/users/1', { parse: withZod(UserSchema),}); Copy
const UserSchema = z.object({ id: z.number(), name: z.string() });const ticket = client.get('/users/1', { parse: withZod(UserSchema),});
Wraps a Zod schema into a ParseFn for use with vereda's
parseoption. UsesparseAsync, so schemas with async refinements/transforms work too.