1.  
  2. /// ‹reference path="Validation.ts" /›
  3. namespace Validation {
  4. const numberRegexp = /^[0-9]+$/;
  5. export class ZipCodeValidator implements StringValidator {
  6. isAcceptable(s: string) {
  7. return s.length === 5 && numberRegexp.test(s);
  8. }
  9. }
  10. }
  11.