Booleans
Boolean decoders for validating and parsing boolean values.
boolean
boolean: Decoder<boolean> (source)
Accepts and returns booleans.
// 👍
boolean.verify(false) === false;
boolean.verify(true) === true;
// 👎
boolean.verify(undefined); // throws
boolean.verify('hello world'); // throws
boolean.verify(123); // throwstruthy
truthy: Decoder<boolean> (source)
Accepts anything and will return its "truth" value. Will never reject.
// 👍
truthy.verify(false) === false;
truthy.verify(true) === true;
truthy.verify(undefined) === false;
truthy.verify('hello world') === true;
truthy.verify('false') === true;
truthy.verify(0) === false;
truthy.verify(1) === true;
truthy.verify(null) === false;
// 👎
// This decoder will never reject an input