Const
The boolean schema validates that the input is either true or false.
boolean
true
false
import { boolean } from "typerun/schema";import { is } from "typerun";if (is(boolean)(true)) { console.log("true is a boolean");}if (!is(boolean)(undefined)) { console.log("undefined is not a boolean");} Copy
import { boolean } from "typerun/schema";import { is } from "typerun";if (is(boolean)(true)) { console.log("true is a boolean");}if (!is(boolean)(undefined)) { console.log("undefined is not a boolean");}
The
boolean
schema validates that the input is eithertrue
orfalse
.Example