decoders

Booleans

Boolean decoders for validating and parsing boolean values.

boolean

boolean: Decoder<boolean> (source)

Accepts and returns booleans.

Try it
boolean.verify(input)
InputResult
false
true
undefined ^^^^^^^^^ Must be boolean
"hello world" ^^^^^^^^^^^^^ Must be boolean
123 ^^^ Must be boolean

truthy

truthy: Decoder<boolean> (source)

Accepts anything and will return its "truth" value. Will never reject.

Try it
truthy.verify(input)
InputResult
false
true
false
true
true
false
true
false

On this page