The schema type being validated
The metadata type passed to validation
Creates a new VineValidator instance with a compiled schema.
The schema type being validated
The metadata type passed to validation
The schema to compile for validation
Configuration options for the validator
Whether to convert empty strings to null
OptionalmetaDataValidator?: MetaDataValidatorOptional metadata validator function
Messages provider for error formatting
Error reporter factory function
Reference to static input type for TypeScript inference
Reference to static output type for TypeScript inference
Messages provider instance used for internationalization and custom error message formatting
Error reporter factory function used for formatting and collecting validation errors
Validates data against the compiled schema. Returns the validated and typed data or throws a ValidationError if validation fails.
The data to validate
Optional validation options including metadata, custom error reporter, and messages provider
The schema to compile for validation
Readonly~standardStandard Schema V1 compliance implementation. Provides interoperability with other validation libraries through the Standard Schema specification.
Performs validation without throwing a ValidationError exception. Instead, returns a tuple where the first element is the error (if any) and the second is the validated data (if successful).
The data to validate
Optional validation options including metadata, custom error reporter, and messages provider
Vine Validator exposes the API to validate data using a pre-compiled schema. This class provides high-performance validation by compiling schemas once and reusing them for multiple validations.
Example