Booleans
Boolean decoders for validating and parsing boolean values.
boolean
boolean: Decoder<boolean> (source)
Accepts and returns booleans.
Try it
| Input | Result |
|---|---|
| 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
| Input | Result |
|---|---|
| false | |
| true | |
| false | |
| true | |
| true | |
| false | |
| true | |
| false |