diff --git a/src/lib/isPassportNumber.js b/src/lib/isPassportNumber.js index 304f72fae..5d28573f4 100644 --- a/src/lib/isPassportNumber.js +++ b/src/lib/isPassportNumber.js @@ -18,6 +18,7 @@ const passportRegexByCountryCode = { CZ: /^\d{8}$/, // CZECH REPUBLIC DE: /^[CFGHJKLMNPRTVWXYZ0-9]{9}$/, // GERMANY DK: /^\d{9}$/, // DENMARK + DZ: /^\d{9}$/, // ALGERIA EE: /^([A-Z]\d{7}|[A-Z]{2}\d{7})$/, // ESTONIA (K followed by 7-digits), e-passports have 2 UPPERCASE followed by 7 digits ES: /^[A-Z0-9]{2}([A-Z0-9]?)\d{6}$/, // SPAIN FI: /^[A-Z]{2}\d{7}$/, // FINLAND diff --git a/test/validators.js b/test/validators.js index d87a1889e..9762d84de 100644 --- a/test/validators.js +++ b/test/validators.js @@ -2010,6 +2010,23 @@ describe('Validators', () => { ], }); + test({ + validator: 'isPassportNumber', + args: ['DZ'], + valid: [ + '855609385', + '154472412', + '197025599', + ], + invalid: [ + 'AS0123456', + 'A012345678', + '0123456789', + '12345678', + '98KK54321', + ], + }); + test({ validator: 'isPassportNumber', args: ['EE'],