Closed stefanhar closed 3 years ago
Looks like we are not checking the months being 01-12, will add a fix and version bump to 1.2.6
this weekend.
Thanks for opening an issue
If you want to NPM patch your local version you could change the isPerson and isCompany functions
function isPerson(kt) {
var d = parseInt(kt.substr(0, 2), 10);
var y = parseInt(kt.substr(2, 4), 10);
return d > 0 && d <= 31 && y > 0 && y <= 12;
}
// Companies have first two characters between 41-71
function isCompany(kt) {
var d = parseInt(kt.substr(0, 2), 10);
var y = parseInt(kt.substr(2, 4), 10);
return d > 40 && d <= 71 && y > 0 && y <= 12;
}
Went ahead and fixed this in 1.2.6
#17
Thanks for the help
The national id
1337991337
passesisValid
andisPerson
checks.