Download Latest Version v1 Because I finally got around to it.zip (283.9 kB)
Email in envelope

Get an email when there's a new version of Yup

Home / v0.19.0
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2016-06-24 531 Bytes
v0.19.0.tar.gz 2016-06-24 65.2 kB
v0.19.0.zip 2016-06-24 90.1 kB
Totals: 3 Items   155.8 kB 0

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'
Source: README.md, updated 2016-06-24