identity-number-validator
Version:
Package to validate if an identity number is valid or not
16 lines (15 loc) • 533 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var ecuador_1 = require("./countries/ecuador");
exports.default = (function (identityNumber, country) {
if (typeof country !== 'string') {
throw Error('Country code must be a string');
}
var upperCaseCountry = country.toUpperCase();
switch (upperCaseCountry) {
case 'EC':
return ecuador_1.ecuadorianIdentifierValidator(identityNumber);
default:
throw Error('Invalid country code');
}
});