Skip to content

Commit

Permalink
Merge pull request #1 from mkreuzmayr/master
Browse files Browse the repository at this point in the history
fix: use parseAsync insted of resolving parse
  • Loading branch information
robertLichtnow authored Sep 10, 2021
2 parents 6ee624e + 1aee153 commit 749993b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function toFormikValidationSchema<T>(
return {
async validate(obj: T) {
try {
await Promise.resolve(schema.parse(obj));
await schema.parseAsync(obj);
} catch (err: unknown) {
throw createValidationError(err as z.ZodError<T>);
}
Expand Down

0 comments on commit 749993b

Please sign in to comment.