A validator that can validate a given data.
Returns a new validator that can handle nullable data.
A new validator that can handle nullable data.
const validator = avery.string().nullable();const result = validator.validate(null);console.log(result.isOk()); // Output: true Copy
const validator = avery.string().nullable();const result = validator.validate(null);console.log(result.isOk()); // Output: true
Validates the given data.
The data to validate.
The validation result.
const validator = avery.string();const result = validator.validate('hello');console.log(result.isOk()); // Output: true Copy
const validator = avery.string();const result = validator.validate('hello');console.log(result.isOk()); // Output: true
A validator that can validate a given data.