import { PropertyValidator } from "../PropertyValidator" ; import * as validatorJS from "validator" ; export class RegExValidator implements PropertyValidator < string > { constructor ( private pattern , private modifiers ? ) { } isValid ( input ) { if ( typeof input === "undefined" || input === null ) { return false ; } return validatorJS . matches ( input , this . pattern , this . modifiers ) ; } }