isBoolean
isBooleanVerifies if provided Verificable represents a boolean value. Only boolean values (true, false) are matching, meaning that 'truthy'/'falsey' values are not matching this Predicate.
Possible errors:
If provided Verificable is not a boolean:
Verificable is not a boolean:{
    type: "isBoolean",
    path: [/* ... */]
}Examples:
Each of examples uses this import statement:
const { asVerificable, isValid, isBoolean } = require("verifica");Null or undefined is not considered a boolean:
const verificable = asVerificable(null);
isValid(verificable, isBoolean); // falseString value is not considered a boolean as well:
const verificable = asVerificable("true");
isValid(verificable, isBoolean); // falsetrue and false are considered boolean values:
true and false are considered boolean values:const verificable = asVerificable(false);
isValid(verificable, isBoolean); // trueLast updated
Was this helpful?