-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A number of files contain ranges of [A-z] which allows the characters [\]^_\ and the back-tick character. Those have been replaced by [A-Za-z].
- Loading branch information
1 parent
39830a9
commit b65ddc5
Showing
4 changed files
with
15 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,17 @@ | ||
import assertString from './util/assertString'; | ||
import { CountryCodes } from './isISO31661Alpha2'; | ||
|
||
const isBICReg = /^[A-z]{4}[A-z]{2}\w{2}(\w{3})?$/; | ||
// https://en.wikipedia.org/wiki/ISO_9362 | ||
const isBICReg = /^[A-Za-z]{6}[A-Za-z0-9]{2}([A-Za-z0-9]{3})?$/; | ||
|
||
export default function isBIC(str) { | ||
assertString(str); | ||
|
||
// toUpperCase() should be removed when a new major version goes out that changes | ||
// the regex to [A-Z] (per the spec). | ||
if (CountryCodes.indexOf(str.slice(4, 6).toUpperCase()) < 0) { | ||
return false; | ||
} | ||
|
||
return isBICReg.test(str); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters