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
{{ message }}
Repository navigation
Unexpected z.coerce.boolean() result with "false" #1672
Yes, yes, it makes sense that what you are doing under the hood is Boolean("whatever") and that means Boolean("false") equates to true...
But I believe this is a silly enough gotcha that it is worth to note in the docs..
Or even if there was a z.coerce.boolean({ treatStringFalseAsFalse: true })
I just don't want people to get confused..
Number(String(123))===123// makes senseBoolean(String(false))!==false// will be a head scratcher at first glance
Activity
colinhacks commentedon Dec 12, 2022
Good call, just added some docs to this effect. This decision is discussed in slightly more detail at #1630
JacobWeisenburger commentedon Dec 25, 2022
Has this been addressed?
If so, can I close this issue?