Open
Description
Describe the bug
As you see here we do not support all over the world countries. I like to collaborate and add more countries regex to that list.
Examples
const validator = require('validator');
const passports = [
{ number: '1408611', country: 'AF' },
{ number: '0007699', country: 'AF' },
{ number: '02444826', country: 'AF' },
{ number: 'D0007699', country: 'AF' },
{ number: 'OA1408611', country: 'AF' },
{ number: 'P02444826', country: 'AF' },
{ number: '910239248', country: 'US' },
{ number: '442578947', country: 'US' },
{ number: '910239248', country: 'US' },
{ number: 'XS1234567', country: 'JP' },
{ number: 'TR4622130', country: 'JP' },
{ number: 'B7499678', country: 'ID' },
{ number: 'A04535897', country: 'ZA' },
{ number: '04535897', country: 'ZA' },
{ number: '04535897', country: 'ZA' },
{ number: '06764100', country: 'TR' },
{ number: 'U06764100', country: 'TR' },
{ number: 'HFF220608', country: 'AE' },
{ number: '220608', country: 'AE' },
];
for (const pass of passports) {
const res1 = validator.isPassportNumber(
pass.number,
pass.country,
);
console.log(res1, pass);
}
Additional context
Validator.js version: 13.7.0
Node.js version: 17.6.0
OS platform: Linux (Ubuntu)
Or please add more country yourself.
Question 🤔
Why you did not complete the list?