Skip to content

Commit

Permalink
fix(isIBAN): narrow regex for VG (validatorjs#2339)
Browse files Browse the repository at this point in the history
  • Loading branch information
ST-DDT authored Jun 1, 2024
1 parent 806e55e commit 28ff5d3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/isIBAN.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ const ibanRegexThroughCountryCode = {
TR: /^(TR[0-9]{2})\d{5}[A-Z0-9]{17}$/,
UA: /^(UA[0-9]{2})\d{6}[A-Z0-9]{19}$/,
VA: /^(VA[0-9]{2})\d{18}$/,
VG: /^(VG[0-9]{2})[A-Z0-9]{4}\d{16}$/,
VG: /^(VG[0-9]{2})[A-Z]{4}\d{16}$/,
XK: /^(XK[0-9]{2})\d{16}$/,
};

Expand Down
2 changes: 2 additions & 0 deletions test/validators.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5360,6 +5360,7 @@ describe('Validators', () => {
'IR200170000000339545727003',
'MZ97123412341234123412341',
'MA64011519000001205000534921',
'VG96VPVG0000012345678901',
'DZ580002100001113000000570',
],
invalid: [
Expand All @@ -5368,6 +5369,7 @@ describe('Validators', () => {
'FR7630006000011234567890189@',
'FR7630006000011234567890189😅',
'FR763000600001123456!!🤨7890189@',
'VG46H07Y0223060094359858',
],
});
test({
Expand Down

0 comments on commit 28ff5d3

Please # to comment.