validation-box
Version:
The only validation library - with flexible regex - you need.
17 lines (16 loc) • 460 B
JavaScript
// src/validators/countries/angola.ts
var validateNIFAO = (nif) => {
return /^\d{9}$/.test(nif);
};
var validatePhoneAO = (phone, requireCountryCode = false) => {
const countryCodeRegex = requireCountryCode ? "(\\+244|244)" : "(\\+244|244)?";
const regex = new RegExp(
`^${countryCodeRegex}\\s?\\d{3}\\s?\\d{3}\\s?\\d{3}$`
);
return regex.test(phone);
};
export {
validateNIFAO,
validatePhoneAO
};
//# sourceMappingURL=chunk-IZ3FNRBL.mjs.map