diff --git a/src/lib/isBIC.js b/src/lib/isBIC.js index b5576b24e..b0f586728 100644 --- a/src/lib/isBIC.js +++ b/src/lib/isBIC.js @@ -9,7 +9,9 @@ export default function isBIC(str) { // toUpperCase() should be removed when a new major version goes out that changes // the regex to [A-Z] (per the spec). - if (!CountryCodes.has(str.slice(4, 6).toUpperCase())) { + const countryCode = str.slice(4, 6).toUpperCase(); + + if (!CountryCodes.has(countryCode) && countryCode !== 'XK') { return false; } diff --git a/test/validators.test.js b/test/validators.test.js index 86b3522b7..3a46a35c1 100644 --- a/test/validators.test.js +++ b/test/validators.test.js @@ -5183,6 +5183,7 @@ describe('Validators', () => { 'SBICKEN1', 'SBICKENY', 'SBICKEN1YYP', + 'SBICXKN1YYP', ], invalid: [ 'SBIC23NXXX', @@ -5191,6 +5192,7 @@ describe('Validators', () => { 'SBICKENXX9', 'SBICKEN13458', 'SBICKEN', + 'SBICXK', ], }); });