Skip to content

Commit 752bd09

Browse files
fix(isPassportNumber): fix regex Azerbaijan (#2284)
* Update isPassportNumber.js Added the updated Azerbaijan passport validation: See issue: #2274 * Update validators.test.js
1 parent 6d5c52a commit 752bd09

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/lib/isPassportNumber.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const passportRegexByCountryCode = {
1111
AR: /^[A-Z]{3}\d{6}$/, // ARGENTINA
1212
AT: /^[A-Z]\d{7}$/, // AUSTRIA
1313
AU: /^[A-Z]\d{7}$/, // AUSTRALIA
14-
AZ: /^[A-Z]{2,3}\d{7,8}$/, // AZERBAIJAN
14+
AZ: /^[A-Z]{1}\d{8}$/, // AZERBAIJAN
1515
BE: /^[A-Z]{2}\d{6}$/, // BELGIUM
1616
BG: /^\d{9}$/, // BULGARIA
1717
BR: /^[A-Z]{2}\d{6}$/, // BRAZIL

test/validators.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2926,11 +2926,11 @@ describe('Validators', () => {
29262926
validator: 'isPassportNumber',
29272927
args: ['AZ'],
29282928
valid: [
2929-
'AZE16175905',
2930-
'AA1617595',
2929+
'A16175905',
2930+
'A16175958',
29312931
],
29322932
invalid: [
2933-
'A12345843',
2933+
'AZ1234584',
29342934
],
29352935
});
29362936

0 commit comments

Comments
 (0)