Skip to content

Commit a8e0005

Browse files
authored
fix(isBIC): add XK to accepted BIC country codes (#2046)
1 parent 91c8bd9 commit a8e0005

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/lib/isBIC.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ export default function isBIC(str) {
99

1010
// toUpperCase() should be removed when a new major version goes out that changes
1111
// the regex to [A-Z] (per the spec).
12-
if (!CountryCodes.has(str.slice(4, 6).toUpperCase())) {
12+
const countryCode = str.slice(4, 6).toUpperCase();
13+
14+
if (!CountryCodes.has(countryCode) && countryCode !== 'XK') {
1315
return false;
1416
}
1517

test/validators.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5183,6 +5183,7 @@ describe('Validators', () => {
51835183
'SBICKEN1',
51845184
'SBICKENY',
51855185
'SBICKEN1YYP',
5186+
'SBICXKN1YYP',
51865187
],
51875188
invalid: [
51885189
'SBIC23NXXX',
@@ -5191,6 +5192,7 @@ describe('Validators', () => {
51915192
'SBICKENXX9',
51925193
'SBICKEN13458',
51935194
'SBICKEN',
5195+
'SBICXK',
51945196
],
51955197
});
51965198
});

0 commit comments

Comments
 (0)