Closed jansedlon closed 4 weeks ago
@farreldarian If you want, i'd be happy to refactor the whole config to valibot v0.31.0 which introduced breaking changes and the whole paradigm changed into using pipe
function. It's still in beta though but at least in my app it's okay
It's still in beta though but at least in my app it's okay
Why not 🚀
This PR slightly improves using the api from
union([literal(), literal()])
because unions are usually used when parsing different data types intopicklist
.It also fixes the usage of using true | false values.
At least on my machine, values that are boolean (eg. verbose) were not parsed correctly and always threw an error saying that it expected 'true' | 'false' but got false.
I figured that it was because in
coerce
method, the callback is executed first and then the validation happens. Which means that it was coerced to boolean and then it was trying to validate two literals which always failed.