Skip to content
Open
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
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2026-09-05 Yash Budhia <yeshbudhia@gmail.com>
* Fixed account number extraction for IE, PT, ME, MU and SC (#544)

2026-04-10 Saša Jovanić <sasa@simplify.ba>
* Version 4.5.4

Expand Down
8 changes: 5 additions & 3 deletions src/ibantools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1308,6 +1308,7 @@ export const countrySpecs: CountryMapInternal = {
SEPA: true,
branch_indentifier: '4-9',
bank_identifier: '0-3',
account_indentifier: '14-21',
},
IL: {
chars: 23,
Expand Down Expand Up @@ -1460,7 +1461,7 @@ export const countrySpecs: CountryMapInternal = {
bban_validation_func: checkMod9710BBAN,
IBANRegistry: true,
bank_identifier: '0-2',
account_indentifier: '4-22',
account_indentifier: '7-19',
},
MF: {
chars: 27,
Expand Down Expand Up @@ -1522,7 +1523,7 @@ export const countrySpecs: CountryMapInternal = {
IBANRegistry: true,
branch_indentifier: '6-7',
bank_identifier: '0-5',
account_indentifier: '0-30',
account_indentifier: '12-23',
},
MV: {},
MW: {},
Expand Down Expand Up @@ -1624,6 +1625,7 @@ export const countrySpecs: CountryMapInternal = {
IBANRegistry: true,
SEPA: true,
bank_identifier: '0-3',
account_indentifier: '12-22',
},
PW: {},
PY: {},
Expand Down Expand Up @@ -1677,7 +1679,7 @@ export const countrySpecs: CountryMapInternal = {
IBANRegistry: true,
branch_indentifier: '6-7',
bank_identifier: '0-5',
account_indentifier: '12-28',
account_indentifier: '12-27',
},
SD: {
chars: 18,
Expand Down
74 changes: 74 additions & 0 deletions test/ibantools_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,80 @@ describe('IBANTools', function() {
});
});

describe('When calling extractIBAN() with valid IBAN from Ireland', function() {
var ext = iban.extractIBAN('IE29AIBK93115212345678');
it('valid should be true', function() {
return expect(ext.valid).to.be.true;
});
it('accountNumber should be 12345678', function() {
return expect(ext.accountNumber).to.equal('12345678');
});
it('bankIdentifier should be AIBK', function() {
return expect(ext.bankIdentifier).to.equal('AIBK');
});
it('branchIdentifier should be 931152', function() {
return expect(ext.branchIdentifier).to.equal('931152');
});
});

describe('When calling extractIBAN() with valid IBAN from Portugal', function() {
var ext = iban.extractIBAN('PT50000201231234567890154');
it('valid should be true', function() {
return expect(ext.valid).to.be.true;
});
it('accountNumber should be 12345678901', function() {
return expect(ext.accountNumber).to.equal('12345678901');
});
it('bankIdentifier should be 0002', function() {
return expect(ext.bankIdentifier).to.equal('0002');
});
});

describe('When calling extractIBAN() with valid IBAN from Montenegro', function() {
var ext = iban.extractIBAN('ME25505000012345678951');
it('valid should be true', function() {
return expect(ext.valid).to.be.true;
});
it('accountNumber should be 0000123456789', function() {
return expect(ext.accountNumber).to.equal('0000123456789');
});
it('bankIdentifier should be 505', function() {
return expect(ext.bankIdentifier).to.equal('505');
});
});

describe('When calling extractIBAN() with valid IBAN from Mauritius', function() {
var ext = iban.extractIBAN('MU17BOMM0101101030300200000MUR');
it('valid should be true', function() {
return expect(ext.valid).to.be.true;
});
it('accountNumber should be 101030300200', function() {
return expect(ext.accountNumber).to.equal('101030300200');
});
it('bankIdentifier should be BOMM01', function() {
return expect(ext.bankIdentifier).to.equal('BOMM01');
});
it('branchIdentifier should be 01', function() {
return expect(ext.branchIdentifier).to.equal('01');
});
});

describe('When calling extractIBAN() with valid IBAN from Seychelles', function() {
var ext = iban.extractIBAN('SC18SSCB11010000000000001497USD');
it('valid should be true', function() {
return expect(ext.valid).to.be.true;
});
it('accountNumber should be 0000000000001497', function() {
return expect(ext.accountNumber).to.equal('0000000000001497');
});
it('bankIdentifier should be SSCB11', function() {
return expect(ext.bankIdentifier).to.equal('SSCB11');
});
it('branchIdentifier should be 01', function() {
return expect(ext.branchIdentifier).to.equal('01');
});
});

describe('When calling extractIBAN() with valid IBAN from Andora', function() {
var ext = iban.extractIBAN('AD1200012030200359100100');
it('valid should be true', function() {
Expand Down