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 valid date object.
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 date schema.
The data to validate.
The validated date object.
Generated using TypeDoc
Interface for validating date values.
const dateSchema = val.DateSchema(); dateSchema.validate(new Date()); // Validates a date object.
ValidationError If the input is not a valid date.
// Example error message: // "Date Failed Validation for: ✖ Expected a valid date, but received a string."