You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Discovering coercion errors during safeParse would be nice. Which goes hand in hand with making the error thrown from parse a ZodError.
Example:
constmaybeBigInt=z.string().pipe(z.coerce.bigint());// works well - returns 0nmaybeBigInt.parse('0');// Returns ZodError as expectedmaybeBigInt.safeParse({});// Throws "SyntaxError"maybeBigInt.safeParse('not a number');
Thank you and let me know if you want me to tackle it with a PR.
The text was updated successfully, but these errors were encountered:
Hello,
Discovering coercion errors during
safeParse
would be nice. Which goes hand in hand with making the error thrown fromparse
aZodError
.Example:
Thank you and let me know if you want me to tackle it with a PR.
The text was updated successfully, but these errors were encountered: