simple-body-validator
Version:
This package is inspired by Laravel validation, and aims to make body validation easier for Javascript developers
19 lines (18 loc) • 599 B
TypeScript
import { ValidationCallback } from '../types';
import RuleContract from './ruleContract';
declare class ClosureValidationRule extends RuleContract {
/**
* The callback that validates the attribute
*/
callback: Function | ValidationCallback;
/**
* Indicates if the validation callback failed.
*/
failed: boolean;
constructor(callback: Function | ValidationCallback);
/**
* Determine if the validation rule passes.
*/
passes(value: any, attribute: string): boolean | Promise<boolean>;
}
export default ClosureValidationRule;