Skip to content
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/lib/isBIC.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ const isBICReg = /^[A-Za-z]{6}[A-Za-z0-9]{2}([A-Za-z0-9]{3})?$/;
export default function isBIC(str) {
assertString(str);

const countryCode = str.slice(4, 6).toUpperCase();

// 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())) {
if (!CountryCodes.has(countryCode) && countryCode !== 'XK') {
return false;
}

Expand Down