Home > @infiniteobjects/data-types > ValidatorConstraintInterface
Custom validators must implement this interface to provide custom validation logic.
Signature:
export type ValidatorConstraintInterface<Target = ObjectLike, ValueType = unknown> = {
validate(value: ValueType, validationArguments?: ValidationArguments<Target>): Promise<boolean> | boolean;
defaultMessage?(validationArguments?: ValidationArguments<Target>): string;
};
References: ObjectLike, ValidationArguments