Skip to main content
Module

x/leaves/mod.ts>validator.ValidatorConstraintInterface

A Web framework For Deno with Decorator and middleware
Latest
interface validator.ValidatorConstraintInterface
Re-export
import { type validator } from "https://deno.land/x/leaves@v0.1.5/mod.ts";
const { ValidatorConstraintInterface } = validator;

Custom validators must implement this interface to provide custom validation logic.

Methods

validate(value: any, validationArguments?: ValidationArguments): Promise<boolean> | boolean

Method to be called to perform custom validation over given value.

optional
defaultMessage(validationArguments?: ValidationArguments): string

Gets default message when validation for this constraint fail.