Skip to content

Commit

Permalink
fix(isPassportNumber): fix regex Azerbaijan (#2284)
Browse files Browse the repository at this point in the history
* Update isPassportNumber.js

Added the updated Azerbaijan passport validation:
See issue:
#2274

* Update validators.test.js
  • Loading branch information
amaliacatalina authored Apr 25, 2024
1 parent 6d5c52a commit 752bd09
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/lib/isPassportNumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const passportRegexByCountryCode = {
AR: /^[A-Z]{3}\d{6}$/, // ARGENTINA
AT: /^[A-Z]\d{7}$/, // AUSTRIA
AU: /^[A-Z]\d{7}$/, // AUSTRALIA
AZ: /^[A-Z]{2,3}\d{7,8}$/, // AZERBAIJAN
AZ: /^[A-Z]{1}\d{8}$/, // AZERBAIJAN
BE: /^[A-Z]{2}\d{6}$/, // BELGIUM
BG: /^\d{9}$/, // BULGARIA
BR: /^[A-Z]{2}\d{6}$/, // BRAZIL
Expand Down
6 changes: 3 additions & 3 deletions test/validators.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2926,11 +2926,11 @@ describe('Validators', () => {
validator: 'isPassportNumber',
args: ['AZ'],
valid: [
'AZE16175905',
'AA1617595',
'A16175905',
'A16175958',
],
invalid: [
'A12345843',
'AZ1234584',
],
});

Expand Down

0 comments on commit 752bd09

Please sign in to comment.