-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problematic Zod schema #4413
base: main
Are you sure you want to change the base?
Problematic Zod schema #4413
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
return ( | ||
(def as z.ZodNumberDef).checks.find((c) => c.kind === 'min')?.value ?? 0 | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JonnyBurger This fixes this particular issue with the min()
or gte()
. Would it make sense to also cover other checks like gt()
and positive()
, multipleOf()
, etc...?
And then would it make sense to also extend the same method to other types like string
and BigInt
for example?
Fixes #4157
In the case where a
min
check exists on aNumber
type, we use that value instead of0
.