From 1aee153a6cb090ad14c0f77b957af51bffd52e30 Mon Sep 17 00:00:00 2001 From: Michael Kreuzmayr Date: Thu, 2 Sep 2021 16:06:56 +0200 Subject: [PATCH] fix: use parseAsync insted of resolving parse --- index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.ts b/index.ts index cfe943e..b883ec0 100644 --- a/index.ts +++ b/index.ts @@ -31,7 +31,7 @@ export function toFormikValidationSchema( 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); }