// Some samples to try let strings = ["Hello", "98052", "101"];
// Validators to use letvalidators: { [s: string]: StringValidator; } = {}; validators["ZIP code"] = newZipCodeValidator(); validators["Letters only"] = newLettersOnlyValidator();
// Show whether each string passed each validator for (let s of strings) { for (let name in validators) { let isMatch = validators[name].isAcceptable(s); console.log(`'${ s }' ${ isMatch ? "matches" : "does not match" } '${ name }'.`); } }
// Some samples to try let strings = ["Hello", "98052", "101"];
// Validators to use letvalidators: { [s: string]: Validation.StringValidator; } = {}; validators["ZIP code"] = newValidation.ZipCodeValidator(); validators["Letters only"] = newValidation.LettersOnlyValidator();
// Show whether each string passed each validator for (let s of strings) { for (let name in validators) { console.log(`"${ s }" - ${ validators[name].isAcceptable(s) ? "matches" : "does not match" }${ name }`); } }
// Some samples to try let strings = ["Hello", "98052", "101"];
// Validators to use letvalidators: { [s: string]: Validation.StringValidator; } = {}; validators["ZIP code"] = newValidation.ZipCodeValidator(); validators["Letters only"] = newValidation.LettersOnlyValidator();
// Show whether each string passed each validator for (let s of strings) { for (let name in validators) { console.log(`"${ s }" - ${ validators[name].isAcceptable(s) ? "matches" : "does not match" }${ name }`); } }