import * as validatorJS from "validator" ; import { PropertyValidator } from "../PropertyValidator" ; import { PostalCodeLocale } from "../../shared/PostalCodeLocale" ; export class IsPostalCodeValidator implements PropertyValidator < string > { constructor ( private locale ) { } isValid ( input ) { if ( input ) { return validatorJS . isPostalCode ( input , this . locale ) ; } return false ; } }