Packages

yup

1.7.1 · 21 Sep 2025MIT16.7M / weekRepositorynpmAtom feed

Your version

0.19.0

24 Jun 2016Where it was published

0.32.11 is the newest release of 0.19.x.

Release note

Type casts no longer "succeed without fail".
For instance boolean will throw if a cast produces an
invalid type, instead of quietly coercing to false. By default
cast will now throw in these situations, passing assert: false
to cast options will disable this behavior and the value returned
will be the invalid value (NaN, InvalidDate, null) or the original value
if no good invalid value exists in the language

number().cast('foo', { assert: false }) // -> NaN
bool().cast('foo', { assert: false })   // -> 'foo'