import { validator } from "https://deno.land/x/leaves@v0.1.5/mod.ts";
const { Validator } = validator;
Validator performs validation of the given object based on its metadata.
Methods
validate(object: Object, options?: ValidatorOptions): Promise<ValidationError[]>
Performs validation of the given object based on decorators used in given object class.
validate(): Promise<ValidationError[]>
Performs validation of the given object based on validation schema.
validateOrReject(object: Object, options?: ValidatorOptions): Promise<void>
Performs validation of the given object based on decorators used in given object class and reject on error.
validateOrReject(): Promise<void>
Performs validation of the given object based on validation schema and reject on error.
validateSync(object: Object, options?: ValidatorOptions): ValidationError[]
Performs validation of the given object based on decorators used in given object class. NOTE: This method completely ignores all async validations.
Performs validation of the given object based on validation schema.