Replies: 1 comment
-
Yes, the fact that you can easily write your own methods and schemas is the cool thing about Valibot. 🧩 Since the default value is only applied to |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Wrote a custom
withDefault
function, because the existing one didn't work for my needs.This one converts falsy values or (in the case of numbers) NaN values to the default value.
Leaving this here, in case anyone else finds it useful.
Beta Was this translation helpful? Give feedback.
All reactions