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 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Wrote a custom
withDefaultfunction, 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.
All reactions