Indicates whether the schema allows undefined
as a valid value.
The type of data that the schema validates, represented as a string.
Coerces the input into a boolean value.
The current schema instance.
Marks the schema as optional, allowing undefined
as a valid value.
The current schema instance.
Parses the input data and returns the parsed value.
This method is typically used to coerce or transform the input data into the desired format.
The input data to parse.
The parsed value.
Validates the input data against the boolean schema.
The data to validate.
The validated boolean value.
Generated using TypeDoc
Interface for validating boolean values.
const booleanSchema = val.BooleanSchema(); booleanSchema.validate(true); // Validates a boolean value.
ValidationError If the input is not a valid boolean.
// Example error message: // "Boolean Failed Validation for: ✖ Expected a boolean value, but received a string."