simple-body-validator
Version:
This package is inspired by Laravel validation, and aims to make body validation easier for Javascript developers
16 lines (15 loc) • 444 B
TypeScript
import RuleContract from './ruleContract';
declare class Regex extends RuleContract {
/**
* The Regular expression to validate
*/
regex: RegExp;
/**
* Flag that decides whether the value should match the regular expression or not
*/
shouldMatch: boolean;
constructor(regex: RegExp, shouldMatch?: boolean);
passes(value: any): boolean;
getMessage(): string;
}
export default Regex;