{"size": 473, "ext": "js", "max_stars_repo_path": "src/app/address/validators/addressValidator.js", "max_stars_repo_name": "alphagov/di-cri-address-front", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/app/address/validators/addressValidator.js", "max_issues_repo_name": "alphagov/di-cri-address-front", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/app/address/validators/addressValidator.js", "max_forks_repo_name": "alphagov/di-cri-address-front", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 26.2777777778, "max_line_length": 67, "alphanum_fraction": 0.6046511628}
module.exports = {
  alphaNumericWithSpecialChars: function (val) {
    if (!val) {
      return true; // handle when field is optional
    }
    return !!val.match(/^[0-9A-Z'.,\\/* -]+$/i);
  },
  isPreviousYear: function (val) {
    return new Date(val).getFullYear() <= new Date().getFullYear();
  },
  validateHouseNumberAndName: function (houseName, houseNumber) {
    if (!houseName.trim() && !houseNumber.trim()) {
      return false;
    }
    return true;
  },
};
