Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(isIBAN): add support for EG and SV #1394

Merged
merged 1 commit into from
Jul 27, 2020
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions src/lib/isIBAN.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const ibanRegexThroughCountryCode = {
DK: /^(DK[0-9]{2})\d{14}$/,
DO: /^(DO[0-9]{2})[A-Z]{4}\d{20}$/,
EE: /^(EE[0-9]{2})\d{16}$/,
EG: /^(EG[0-9]{2})\d{25}$/,
ES: /^(ES[0-9]{2})\d{20}$/,
FI: /^(FI[0-9]{2})\d{14}$/,
FO: /^(FO[0-9]{2})\d{14}$/,
Expand Down Expand Up @@ -74,6 +75,7 @@ const ibanRegexThroughCountryCode = {
SI: /^(SI[0-9]{2})\d{15}$/,
SK: /^(SK[0-9]{2})\d{20}$/,
SM: /^(SM[0-9]{2})[A-Z]{1}\d{10}[A-Z0-9]{12}$/,
SV: /^(SV[0-9]{2})[A-Z0-9]{4}\d{20}$/,
TL: /^(TL[0-9]{2})\d{19}$/,
TN: /^(TN[0-9]{2})\d{20}$/,
TR: /^(TR[0-9]{2})\d{5}[A-Z0-9]{17}$/,
Expand Down
5 changes: 5 additions & 0 deletions test/validators.js
Original file line number Diff line number Diff line change
Expand Up @@ -3954,6 +3954,11 @@ describe('Validators', () => {
test({
validator: 'isIBAN',
valid: [
'SC52BAHL01031234567890123456USD',
'LC14BOSL123456789012345678901234',
'MT31MALT01100000000000000000123',
'SV43ACAT00000000000000123123',
'EG800002000156789012345180002',
'BE71 0961 2345 6769',
'FR76 3000 6000 0112 3456 7890 189',
'DE91 1000 0000 0123 4567 89',
Expand Down