ibantools 4.1.2 → 4.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,7 +8,7 @@
8
8
  * @package Documentation
9
9
  * @author Saša Jovanić
10
10
  * @module ibantools
11
- * @version 4.1.2
11
+ * @version 4.1.5
12
12
  * @license MPL-2.0
13
13
  * @preferred
14
14
  */
@@ -27,21 +27,16 @@ exports.countrySpecs = exports.extractBIC = exports.validateBIC = exports.Valida
27
27
  * ```
28
28
  */
29
29
  function isValidIBAN(iban) {
30
- if (iban !== undefined && iban !== null) {
31
- var reg = new RegExp('^[0-9]{2}$', '');
32
- var spec = exports.countrySpecs[iban.slice(0, 2)];
33
- if (spec !== undefined &&
34
- spec.bban_regexp &&
35
- spec.bban_regexp !== null &&
36
- spec.chars &&
37
- spec.chars === iban.length &&
38
- reg.test(iban.slice(2, 4)) &&
39
- isValidBBAN(iban.slice(4), iban.slice(0, 2)) &&
40
- isValidIBANChecksum(iban)) {
41
- return true;
42
- }
43
- }
44
- return false;
30
+ if (iban === undefined || iban === null)
31
+ return false;
32
+ var reg = new RegExp('^[0-9]{2}$', '');
33
+ var spec = exports.countrySpecs[iban.slice(0, 2)];
34
+ if (spec === undefined || spec.bban_regexp === undefined || spec.bban_regexp === null || spec.chars === undefined)
35
+ return false;
36
+ return (spec.chars === iban.length &&
37
+ reg.test(iban.slice(2, 4)) &&
38
+ isValidBBAN(iban.slice(4), iban.slice(0, 2)) &&
39
+ isValidIBANChecksum(iban));
45
40
  }
46
41
  exports.isValidIBAN = isValidIBAN;
47
42
  /**
@@ -115,21 +110,21 @@ exports.validateIBAN = validateIBAN;
115
110
  * ```
116
111
  */
117
112
  function isValidBBAN(bban, countryCode) {
118
- if (bban !== undefined && bban !== null && countryCode !== undefined && countryCode !== null) {
119
- var spec = exports.countrySpecs[countryCode];
120
- if (spec !== undefined &&
121
- spec !== null &&
122
- spec.bban_regexp &&
123
- spec.bban_regexp !== null &&
124
- spec.chars &&
125
- spec.chars !== null &&
126
- spec.chars - 4 === bban.length &&
127
- checkFormatBBAN(bban, spec.bban_regexp)) {
128
- if (spec.bban_validation_func) {
129
- return spec.bban_validation_func(bban.replace(/[\s.]+/g, ''));
130
- }
131
- return true;
113
+ if (bban === undefined || bban === null || countryCode === undefined || countryCode === null)
114
+ return false;
115
+ var spec = exports.countrySpecs[countryCode];
116
+ if (spec === undefined ||
117
+ spec === null ||
118
+ spec.bban_regexp === undefined ||
119
+ spec.bban_regexp === null ||
120
+ spec.chars === undefined ||
121
+ spec.chars === null)
122
+ return false;
123
+ if (spec.chars - 4 === bban.length && checkFormatBBAN(bban, spec.bban_regexp)) {
124
+ if (spec.bban_validation_func) {
125
+ return spec.bban_validation_func(bban.replace(/[\s.]+/g, ''));
132
126
  }
127
+ return true;
133
128
  }
134
129
  return false;
135
130
  }
@@ -192,10 +187,11 @@ exports.composeIBAN = composeIBAN;
192
187
  */
193
188
  function extractIBAN(iban) {
194
189
  var result = {};
195
- result.iban = iban;
196
- if (isValidIBAN(iban)) {
197
- result.bban = iban.slice(4);
198
- result.countryCode = iban.slice(0, 2);
190
+ var eFormatIBAN = electronicFormatIBAN(iban);
191
+ result.iban = eFormatIBAN || iban;
192
+ if (!!eFormatIBAN && isValidIBAN(eFormatIBAN)) {
193
+ result.bban = eFormatIBAN.slice(4);
194
+ result.countryCode = eFormatIBAN.slice(0, 2);
199
195
  result.valid = true;
200
196
  }
201
197
  else {
@@ -263,43 +259,54 @@ exports.friendlyFormatIBAN = friendlyFormatIBAN;
263
259
  * @ignore
264
260
  */
265
261
  function isValidIBANChecksum(iban) {
262
+ var countryCode = iban.slice(0, 2);
266
263
  var providedChecksum = parseInt(iban.slice(2, 4), 10);
267
- var temp = iban.slice(3) + iban.slice(0, 2) + '00';
268
- var validationString = '';
269
- for (var n = 1; n < temp.length; n++) {
270
- var c = temp.charCodeAt(n);
271
- if (c >= 65) {
272
- validationString += (c - 55).toString();
273
- }
274
- else {
275
- validationString += temp[n];
276
- }
277
- }
278
- while (validationString.length > 2) {
279
- var part = validationString.slice(0, 6);
280
- validationString = (parseInt(part, 10) % 97).toString() + validationString.slice(part.length);
281
- }
282
- var rest = parseInt(validationString, 10) % 97;
264
+ var bban = iban.slice(4);
265
+ // Wikipedia[validating_iban] says there are a specif way to check if a IBAN is valid but
266
+ // it. It says 'If the remainder is 1, the check digit test is passed and the
267
+ // IBAN might be valid.'. might, MIGHT!
268
+ // We don't want might but want yes or no. Since every BBAN is IBAN from the fifth
269
+ // (slice(4)) we can generate the IBAN from BBAN and country code(two first characters)
270
+ // from in the IBAN.
271
+ // To generate the (generate the iban check digits)[generating-iban-check]
272
+ // Move the country code to the end
273
+ // remove the checksum from the begging
274
+ // Add "00" to the end
275
+ // modulo 97 on the amount
276
+ // subtract remainder from 98, (98 - remainder)
277
+ // Add a leading 0 if the remainder is less then 10 (padStart(2, "0")) (we skip this
278
+ // since we compare int, not string)
279
+ //
280
+ // [validating_iban][https://en.wikipedia.org/wiki/International_Bank_Account_Number#Validating_the_IBAN]
281
+ // [generating-iban-check][https://en.wikipedia.org/wiki/International_Bank_Account_Number#Generating_IBAN_check_digits]
282
+ var validationString = replaceCharaterWithCode("".concat(bban).concat(countryCode, "00"));
283
+ var rest = mod9710(validationString);
283
284
  return 98 - rest === providedChecksum;
284
285
  }
286
+ /**
287
+ * Iban contain characters and should be converted to intereger by 55 substracted
288
+ * from there ascii value
289
+ *
290
+ * @ignore
291
+ */
292
+ function replaceCharaterWithCode(str) {
293
+ // It is slower but alot more readable
294
+ // https://jsbench.me/ttkzgsekae/1
295
+ return str
296
+ .split('')
297
+ .map(function (c) {
298
+ var code = c.charCodeAt(0);
299
+ return code >= 65 ? (code - 55).toString() : c;
300
+ })
301
+ .join('');
302
+ }
285
303
  /**
286
304
  * MOD-97-10
287
305
  *
288
306
  * @ignore
289
307
  */
290
308
  function mod9710Iban(iban) {
291
- iban = iban.slice(3) + iban.slice(0, 4);
292
- var validationString = '';
293
- for (var n = 1; n < iban.length; n++) {
294
- var c = iban.charCodeAt(n);
295
- if (c >= 65) {
296
- validationString += (c - 55).toString();
297
- }
298
- else {
299
- validationString += iban[n];
300
- }
301
- }
302
- return mod9710(validationString);
309
+ return mod9710(replaceCharaterWithCode(iban.slice(3) + iban.slice(0, 4)));
303
310
  }
304
311
  /**
305
312
  * Returns specifications for all countries, even those who are not
@@ -328,10 +335,10 @@ function getCountrySpecifications() {
328
335
  for (var countyCode in exports.countrySpecs) {
329
336
  var county = exports.countrySpecs[countyCode];
330
337
  countyMap[countyCode] = {
331
- chars: county.chars ? county.chars : null,
332
- bban_regexp: county.bban_regexp ? county.bban_regexp : null,
333
- IBANRegistry: county.IBANRegistry ? county.IBANRegistry : false,
334
- SEPA: county.SEPA ? county.SEPA : false,
338
+ chars: county.chars || null,
339
+ bban_regexp: county.bban_regexp || null,
340
+ IBANRegistry: county.IBANRegistry || false,
341
+ SEPA: county.SEPA || false,
335
342
  };
336
343
  }
337
344
  return countyMap;
@@ -443,23 +450,6 @@ var checkNorwayBBAN = function (bban) {
443
450
  var remainder = sum % 11;
444
451
  return controlDigit === (remainder === 0 ? 0 : 11 - remainder);
445
452
  };
446
- /**
447
- * Used for Netherlands BBAN check
448
- *
449
- * @ignore
450
- */
451
- var checkDutchBBAN = function (bban) {
452
- var bbanWithoutSpacesAndPeriods = bban.replace(/[\s.]+/g, '');
453
- var accountNumber = bbanWithoutSpacesAndPeriods.substring(4, 14);
454
- if (accountNumber.startsWith('000')) {
455
- return true; // Postbank account, no `elfproef` possible
456
- }
457
- var sum = 0;
458
- for (var index = 0; index < 10; index++) {
459
- sum += parseInt(accountNumber.charAt(index), 10) * (10 - index);
460
- }
461
- return sum % 11 === 0;
462
- };
463
453
  /**
464
454
  * Used for Belgian BBAN check
465
455
  *
@@ -479,8 +469,17 @@ var checkBelgianBBAN = function (bban) {
479
469
  */
480
470
  var mod9710 = function (validationString) {
481
471
  while (validationString.length > 2) {
472
+ // > Any computer programming language or software package that is used to compute D
473
+ // > mod 97 directly must have the ability to handle integers of more than 30 digits.
474
+ // > In practice, this can only be done by software that either supports
475
+ // > arbitrary-precision arithmetic or that can handle 219-bit (unsigned) integers
476
+ // https://en.wikipedia.org/wiki/International_Bank_Account_Number#Modulo_operation_on_IBAN
482
477
  var part = validationString.slice(0, 6);
483
- validationString = (parseInt(part, 10) % 97).toString() + validationString.slice(part.length);
478
+ var partInt = parseInt(part, 10);
479
+ if (isNaN(partInt)) {
480
+ return NaN;
481
+ }
482
+ validationString = (partInt % 97) + validationString.slice(part.length);
484
483
  }
485
484
  return parseInt(validationString, 10) % 97;
486
485
  };
@@ -1224,11 +1223,16 @@ exports.countrySpecs = {
1224
1223
  NL: {
1225
1224
  chars: 18,
1226
1225
  bban_regexp: '^[A-Z]{4}[0-9]{10}$',
1227
- bban_validation_func: checkDutchBBAN,
1228
1226
  IBANRegistry: true,
1229
1227
  SEPA: true,
1230
1228
  },
1231
- NO: { chars: 15, bban_regexp: '^[0-9]{11}$', bban_validation_func: checkNorwayBBAN, IBANRegistry: true, SEPA: true },
1229
+ NO: {
1230
+ chars: 15,
1231
+ bban_regexp: '^[0-9]{11}$',
1232
+ bban_validation_func: checkNorwayBBAN,
1233
+ IBANRegistry: true,
1234
+ SEPA: true,
1235
+ },
1232
1236
  NP: {},
1233
1237
  NR: {},
1234
1238
  NU: {},
@@ -8,7 +8,7 @@
8
8
  * @package Documentation
9
9
  * @author Saša Jovanić
10
10
  * @module ibantools
11
- * @version 4.1.2
11
+ * @version 4.1.5
12
12
  * @license MPL-2.0
13
13
  * @preferred
14
14
  */
@@ -25,21 +25,16 @@
25
25
  * ```
26
26
  */
27
27
  export function isValidIBAN(iban) {
28
- if (iban !== undefined && iban !== null) {
29
- var reg = new RegExp('^[0-9]{2}$', '');
30
- var spec = countrySpecs[iban.slice(0, 2)];
31
- if (spec !== undefined &&
32
- spec.bban_regexp &&
33
- spec.bban_regexp !== null &&
34
- spec.chars &&
35
- spec.chars === iban.length &&
36
- reg.test(iban.slice(2, 4)) &&
37
- isValidBBAN(iban.slice(4), iban.slice(0, 2)) &&
38
- isValidIBANChecksum(iban)) {
39
- return true;
40
- }
41
- }
42
- return false;
28
+ if (iban === undefined || iban === null)
29
+ return false;
30
+ var reg = new RegExp('^[0-9]{2}$', '');
31
+ var spec = countrySpecs[iban.slice(0, 2)];
32
+ if (spec === undefined || spec.bban_regexp === undefined || spec.bban_regexp === null || spec.chars === undefined)
33
+ return false;
34
+ return (spec.chars === iban.length &&
35
+ reg.test(iban.slice(2, 4)) &&
36
+ isValidBBAN(iban.slice(4), iban.slice(0, 2)) &&
37
+ isValidIBANChecksum(iban));
43
38
  }
44
39
  /**
45
40
  * IBAM validation errors
@@ -111,21 +106,21 @@ export function validateIBAN(iban) {
111
106
  * ```
112
107
  */
113
108
  export function isValidBBAN(bban, countryCode) {
114
- if (bban !== undefined && bban !== null && countryCode !== undefined && countryCode !== null) {
115
- var spec = countrySpecs[countryCode];
116
- if (spec !== undefined &&
117
- spec !== null &&
118
- spec.bban_regexp &&
119
- spec.bban_regexp !== null &&
120
- spec.chars &&
121
- spec.chars !== null &&
122
- spec.chars - 4 === bban.length &&
123
- checkFormatBBAN(bban, spec.bban_regexp)) {
124
- if (spec.bban_validation_func) {
125
- return spec.bban_validation_func(bban.replace(/[\s.]+/g, ''));
126
- }
127
- return true;
109
+ if (bban === undefined || bban === null || countryCode === undefined || countryCode === null)
110
+ return false;
111
+ var spec = countrySpecs[countryCode];
112
+ if (spec === undefined ||
113
+ spec === null ||
114
+ spec.bban_regexp === undefined ||
115
+ spec.bban_regexp === null ||
116
+ spec.chars === undefined ||
117
+ spec.chars === null)
118
+ return false;
119
+ if (spec.chars - 4 === bban.length && checkFormatBBAN(bban, spec.bban_regexp)) {
120
+ if (spec.bban_validation_func) {
121
+ return spec.bban_validation_func(bban.replace(/[\s.]+/g, ''));
128
122
  }
123
+ return true;
129
124
  }
130
125
  return false;
131
126
  }
@@ -185,10 +180,11 @@ export function composeIBAN(params) {
185
180
  */
186
181
  export function extractIBAN(iban) {
187
182
  var result = {};
188
- result.iban = iban;
189
- if (isValidIBAN(iban)) {
190
- result.bban = iban.slice(4);
191
- result.countryCode = iban.slice(0, 2);
183
+ var eFormatIBAN = electronicFormatIBAN(iban);
184
+ result.iban = eFormatIBAN || iban;
185
+ if (!!eFormatIBAN && isValidIBAN(eFormatIBAN)) {
186
+ result.bban = eFormatIBAN.slice(4);
187
+ result.countryCode = eFormatIBAN.slice(0, 2);
192
188
  result.valid = true;
193
189
  }
194
190
  else {
@@ -253,43 +249,54 @@ export function friendlyFormatIBAN(iban, separator) {
253
249
  * @ignore
254
250
  */
255
251
  function isValidIBANChecksum(iban) {
252
+ var countryCode = iban.slice(0, 2);
256
253
  var providedChecksum = parseInt(iban.slice(2, 4), 10);
257
- var temp = iban.slice(3) + iban.slice(0, 2) + '00';
258
- var validationString = '';
259
- for (var n = 1; n < temp.length; n++) {
260
- var c = temp.charCodeAt(n);
261
- if (c >= 65) {
262
- validationString += (c - 55).toString();
263
- }
264
- else {
265
- validationString += temp[n];
266
- }
267
- }
268
- while (validationString.length > 2) {
269
- var part = validationString.slice(0, 6);
270
- validationString = (parseInt(part, 10) % 97).toString() + validationString.slice(part.length);
271
- }
272
- var rest = parseInt(validationString, 10) % 97;
254
+ var bban = iban.slice(4);
255
+ // Wikipedia[validating_iban] says there are a specif way to check if a IBAN is valid but
256
+ // it. It says 'If the remainder is 1, the check digit test is passed and the
257
+ // IBAN might be valid.'. might, MIGHT!
258
+ // We don't want might but want yes or no. Since every BBAN is IBAN from the fifth
259
+ // (slice(4)) we can generate the IBAN from BBAN and country code(two first characters)
260
+ // from in the IBAN.
261
+ // To generate the (generate the iban check digits)[generating-iban-check]
262
+ // Move the country code to the end
263
+ // remove the checksum from the begging
264
+ // Add "00" to the end
265
+ // modulo 97 on the amount
266
+ // subtract remainder from 98, (98 - remainder)
267
+ // Add a leading 0 if the remainder is less then 10 (padStart(2, "0")) (we skip this
268
+ // since we compare int, not string)
269
+ //
270
+ // [validating_iban][https://en.wikipedia.org/wiki/International_Bank_Account_Number#Validating_the_IBAN]
271
+ // [generating-iban-check][https://en.wikipedia.org/wiki/International_Bank_Account_Number#Generating_IBAN_check_digits]
272
+ var validationString = replaceCharaterWithCode("".concat(bban).concat(countryCode, "00"));
273
+ var rest = mod9710(validationString);
273
274
  return 98 - rest === providedChecksum;
274
275
  }
276
+ /**
277
+ * Iban contain characters and should be converted to intereger by 55 substracted
278
+ * from there ascii value
279
+ *
280
+ * @ignore
281
+ */
282
+ function replaceCharaterWithCode(str) {
283
+ // It is slower but alot more readable
284
+ // https://jsbench.me/ttkzgsekae/1
285
+ return str
286
+ .split('')
287
+ .map(function (c) {
288
+ var code = c.charCodeAt(0);
289
+ return code >= 65 ? (code - 55).toString() : c;
290
+ })
291
+ .join('');
292
+ }
275
293
  /**
276
294
  * MOD-97-10
277
295
  *
278
296
  * @ignore
279
297
  */
280
298
  function mod9710Iban(iban) {
281
- iban = iban.slice(3) + iban.slice(0, 4);
282
- var validationString = '';
283
- for (var n = 1; n < iban.length; n++) {
284
- var c = iban.charCodeAt(n);
285
- if (c >= 65) {
286
- validationString += (c - 55).toString();
287
- }
288
- else {
289
- validationString += iban[n];
290
- }
291
- }
292
- return mod9710(validationString);
299
+ return mod9710(replaceCharaterWithCode(iban.slice(3) + iban.slice(0, 4)));
293
300
  }
294
301
  /**
295
302
  * Returns specifications for all countries, even those who are not
@@ -318,10 +325,10 @@ export function getCountrySpecifications() {
318
325
  for (var countyCode in countrySpecs) {
319
326
  var county = countrySpecs[countyCode];
320
327
  countyMap[countyCode] = {
321
- chars: county.chars ? county.chars : null,
322
- bban_regexp: county.bban_regexp ? county.bban_regexp : null,
323
- IBANRegistry: county.IBANRegistry ? county.IBANRegistry : false,
324
- SEPA: county.SEPA ? county.SEPA : false,
328
+ chars: county.chars || null,
329
+ bban_regexp: county.bban_regexp || null,
330
+ IBANRegistry: county.IBANRegistry || false,
331
+ SEPA: county.SEPA || false,
325
332
  };
326
333
  }
327
334
  return countyMap;
@@ -429,23 +436,6 @@ var checkNorwayBBAN = function (bban) {
429
436
  var remainder = sum % 11;
430
437
  return controlDigit === (remainder === 0 ? 0 : 11 - remainder);
431
438
  };
432
- /**
433
- * Used for Netherlands BBAN check
434
- *
435
- * @ignore
436
- */
437
- var checkDutchBBAN = function (bban) {
438
- var bbanWithoutSpacesAndPeriods = bban.replace(/[\s.]+/g, '');
439
- var accountNumber = bbanWithoutSpacesAndPeriods.substring(4, 14);
440
- if (accountNumber.startsWith('000')) {
441
- return true; // Postbank account, no `elfproef` possible
442
- }
443
- var sum = 0;
444
- for (var index = 0; index < 10; index++) {
445
- sum += parseInt(accountNumber.charAt(index), 10) * (10 - index);
446
- }
447
- return sum % 11 === 0;
448
- };
449
439
  /**
450
440
  * Used for Belgian BBAN check
451
441
  *
@@ -465,8 +455,17 @@ var checkBelgianBBAN = function (bban) {
465
455
  */
466
456
  var mod9710 = function (validationString) {
467
457
  while (validationString.length > 2) {
458
+ // > Any computer programming language or software package that is used to compute D
459
+ // > mod 97 directly must have the ability to handle integers of more than 30 digits.
460
+ // > In practice, this can only be done by software that either supports
461
+ // > arbitrary-precision arithmetic or that can handle 219-bit (unsigned) integers
462
+ // https://en.wikipedia.org/wiki/International_Bank_Account_Number#Modulo_operation_on_IBAN
468
463
  var part = validationString.slice(0, 6);
469
- validationString = (parseInt(part, 10) % 97).toString() + validationString.slice(part.length);
464
+ var partInt = parseInt(part, 10);
465
+ if (isNaN(partInt)) {
466
+ return NaN;
467
+ }
468
+ validationString = (partInt % 97) + validationString.slice(part.length);
470
469
  }
471
470
  return parseInt(validationString, 10) % 97;
472
471
  };
@@ -1210,11 +1209,16 @@ export var countrySpecs = {
1210
1209
  NL: {
1211
1210
  chars: 18,
1212
1211
  bban_regexp: '^[A-Z]{4}[0-9]{10}$',
1213
- bban_validation_func: checkDutchBBAN,
1214
1212
  IBANRegistry: true,
1215
1213
  SEPA: true,
1216
1214
  },
1217
- NO: { chars: 15, bban_regexp: '^[0-9]{11}$', bban_validation_func: checkNorwayBBAN, IBANRegistry: true, SEPA: true },
1215
+ NO: {
1216
+ chars: 15,
1217
+ bban_regexp: '^[0-9]{11}$',
1218
+ bban_validation_func: checkNorwayBBAN,
1219
+ IBANRegistry: true,
1220
+ SEPA: true,
1221
+ },
1218
1222
  NP: {},
1219
1223
  NR: {},
1220
1224
  NU: {},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ibantools",
3
- "version": "4.1.2",
3
+ "version": "4.1.5",
4
4
  "description": "Validation, extraction and creation of IBAN, BBAN, BIC/SWIFT numbers plus some other helpful stuff like ISO 3136-1 alpha 2 country list",
5
5
  "keywords": [
6
6
  "IBAN",
@@ -53,18 +53,16 @@
53
53
  "@typescript-eslint/eslint-plugin": "^4.28.4",
54
54
  "@typescript-eslint/parser": "^4.28.4",
55
55
  "chai": "^4.3.4",
56
- "cheerio": "^0.22",
57
56
  "coveralls": "^3.1.1",
58
57
  "docdash": "^1.2.0",
59
58
  "eslint": "^7.31.0",
60
59
  "eslint-config-prettier": "^8.3.0",
61
60
  "eslint-plugin-prettier": "^4.0.0",
62
61
  "gulp": "^4.0.2",
63
- "gulp-mocha": "^8.0",
64
62
  "gulp-rename": "^2.0",
65
63
  "gulp-shell": "^0.8.0",
66
64
  "gulp-typescript": "^5.0",
67
- "jasmine-core": "^3.8.0",
65
+ "jasmine-core": "^4.0.0",
68
66
  "karma": "^6.3.4",
69
67
  "karma-chrome-launcher": "^3.1",
70
68
  "karma-jasmine": "^4.0",
package/ChangeLog DELETED
@@ -1,266 +0,0 @@
1
- 2021-12-14 Saša Jovanić <sasa@simplify.ba>
2
- * Version 4.1.2
3
- * Fix issue #83 - Fix problem when country can not be found when calling `validateIBAN`
4
-
5
- 2021-12-05 Saša Jovanić <sasa@simplify.ba>
6
- * Version 4.1.1
7
- * Added Hungarian (HU) BBAN validation
8
-
9
- 2021-12-01 Saša Jovanić <sasa@simplify.ba>
10
- * Improve test coverage
11
-
12
- 2021-11-30 Saša Jovanić <sasa@simplify.ba>
13
- * Added Estonian (EE) BBAN validation
14
- * Added Finland (FI) BBAN validation
15
- * Aland Islands (AX) uses BBAN valkidation from Finland
16
- * Added French (FR) and Monaco (MC) BBAN validation
17
-
18
- 2021-11-28 Saša Jovanić <sasa@simplify.ba>
19
- * Added Czech (CZ) BBAN validation
20
-
21
- 2021-11-27 Saša Jovanić <sasa@simplify.ba>
22
- * Added Croatian (HR) BBAN validation
23
-
24
- 2021-11-25 Saša Jovanić <sasa@simplify.ba>
25
- * Version 4.1.0
26
- * Added Belgian (BE) extra BBAN validation
27
- * Added mod97/10 BBAN validation for countries that do it that way: BA, ME, MK, PT, RS and SI
28
-
29
- 2021-11-24 Saša Jovanić <sasa@simplify.ba>
30
- * Added Netherlands (NL) extra BBAN validation
31
- * Added extra error code when validating IBAN `WrongAccountBankBranchChecksum` that indicates when checksum for account number or bank or branch code is incorrect
32
-
33
- 2021-11-23 Saša Jovanić <sasa@simplify.ba>
34
- * Version 4.0.1
35
- * Fixed bug when validating Spain IBAN
36
-
37
- 2021-11-18 Saša Jovanić <sasa@simplify.ba>
38
- * Updated README with new and updated badges
39
- * Fixed documentation on GH pages
40
- * Added dependabot dependency updates and merged some created dependency pull requests
41
- * Added Node 17 to build version on GitHub actions
42
- * Added GitHub CodeQL workflow
43
-
44
- 2021-11-17 Saša Jovanić <sasa@simplify.ba>
45
- * Version 4.0.0
46
- * Fixed Senegal (SN) regular expression
47
- * Updated Burundi (BI) specification
48
- * Added Spain (ES) extra BBAN validation
49
- * Added Poland (PL) extra BBAN validation
50
- * Added test to check for extra BBAN validation function
51
-
52
- 2021-09-30 Simen Mailund Svendsen <simen.m.s@hotmail.com>
53
- * Fix invalid norwegian BBANS (failing MOD11 check) being incorrectly returned as valid
54
-
55
- 2021-07-24 Saša Jovanić <sasa@simplify.ba>
56
- * Version 3.3.1
57
- * Fixed issue not showing AD and BG as SEPA countries
58
- * Fixed issue when incorrectly showing GL and FO as SEPA countryes
59
- * Fixed incorrect documentation for `composeIBAN`
60
- * Updates list of supported Node.js versions
61
- * Update dev dependencies
62
-
63
- 2021-05-05 Daniel Friesen <d@danf.ca>
64
- * Fixed `validateIBAN`'s handling of unsupported countries like US
65
- * Added checksum validation for unsupported/unknown countries to `validateIBAN`
66
-
67
- 2021-04-03 Saša Jovanić <sasa@simplify.ba>
68
- * Coverage improved to 100%
69
-
70
- 2021-04-03 Saša Jovanić <sasa@simplify.ba>
71
- * Version 3.3.0
72
- * Error codes for IBAN and BIC validation. Added `validateIBAN` and `validateBIC` methods that will return error codes.
73
-
74
- 2021-04-03 Saša Jovanić <sasa@simplify.ba>
75
- * Version 3.2.5
76
- * (Dependabot) Bump y18n from 3.2.1 to 3.2.2
77
-
78
- 2021-03-29 Xavier Alvarez
79
- * Fix validation for Burkina Faso, Benin, Algeria and Mali
80
-
81
- 2021-03-10 Saša Jovanić <sasa@simplify.ba>
82
- * Version 3.2.4
83
- * Exported `countrySpecs` to restore a bit of compatibility broken in 3.2.3
84
- * Updated development dependencies
85
- * Documentation is now part of master branch
86
-
87
- 2021-02-07 Saša Jovanić <sasa@simplify.ba>
88
- * Version 3.2.3
89
- * Dependabot PR merged
90
-
91
- 2021-02-06 Richard Leurs
92
- * Improve bundle size
93
-
94
- 2020-11-10 Saša Jovanić <sasa@simplify.ba>
95
- * Version 3.2.2
96
- * Fixed support for Cape Verde
97
- * Dependabot PR merged
98
-
99
- 2020-11-10 Saša Jovanić <sasa@simplify.ba>
100
- * Switch from `jsdoc` to `typedoc` for documentation generation
101
- * Typo in interface name fixed, this will require mayor version release
102
-
103
- 2020-11-09 Saša Jovanić <sasa@simplify.ba>
104
- * Removed `tslint` and added `eslint` and `prettier` to be used with `gulp lint` task
105
- * Added GitHub Action for linting to workflow
106
- * Updated PR template on GitHub and modified `CONTRIBUTING.md` document
107
-
108
- 2020-11-04 Saša Jovanić <sasa@simplify.ba>
109
- * Version 3.2.1
110
- * Merged PR from @witoldsz: Fixed Azerbaijan IBAN check regexp
111
-
112
- 2020-11-04 Saša Jovanić <sasa@simplify.ba>
113
- * Removed Travis CI integration and integrated Github Action to show badge on master branch and status on pull requests
114
- * Upgraded to `typescript` 4
115
-
116
- 2020-11-03 Saša Jovanić <sasa@simplify.ba>
117
- * Version 3.2.0
118
- * Added Node 15 and removed node 13 to Travis environments
119
- * Updated various development dependencies
120
- * Test file is no longer written in TypeScript - types/chai is a problem when building for ES5
121
- * Switched from `istanbul` to `nyc` for code coverage
122
- * Added Libya as new addition to official IBAN registry
123
- * Fix crash when `isValidBIC` receives `null` or `undefined`
124
- * Added Github Build Action as preparation to move away from Travis CI
125
-
126
- 2020-06-21 Saša Jovanić <sasa@simplify.ba>
127
- * Version 3.1.0
128
- * Merged PR from @EarthlingRich (Richard Leurs) that adds `isSEPACountry` function.
129
- * Fixed RegExp for Seychelles
130
- * Added Node 14 to Travis environments
131
-
132
- 2020-04-05 Saša Jovanić <sasa@simplify.ba>
133
- * Version 3.0.0
134
-
135
- 2020-03-31 Saša Jovanić <sasa@simplify.ba>
136
- * Updated some dev dependencies
137
-
138
- 2020-03-29 Saša Jovanić <sasa@simplify.ba>
139
- * Merged #18 - Drop country names from output - PR from @eemeli (Eemeli Aro) that removes country names from functions output. Country code is still present. This will reduce total bundle size. If you still need country names, please use `countrynames` or `country-iso` packages.
140
- * Merged various dependabot pull requests.
141
- * Added prettier as dev dependency.
142
- * Upgraded dependencies based on `npm audit`.
143
- * Added node 13 and dropped node 11 on Travis.
144
- * Added Egypt as new addition to official IBAN specification.
145
- * Added countries that are not in official IBAN specification published by Swift: Algeria, Angola, Benin, Burkina Faso, Burundi, Cameroon, Cape Verde, Iran, Ivory Coast, Madagascar, Mali, Mozambique, Senegal, Comoros, Chad, Gabon, Honduras, Morocco, Nicaragua, Niger, Togo, Central African Republic, Djibouti, Equatorial Guinea and Guinea-Bissau.
146
-
147
- 2019-08-12 Saša Jovanić <sasa@simplify.ba>
148
- * Released varsion 2.2.0
149
- * Fixed Swift register PDF link on README file
150
- * Fixed problem with invalid IBAN checksum structure (GH16)
151
- * When checking if IBAN checksum is valid we will generate IBAN checksum and compare it with existing one instead of checking if result of mod97-10 is 1
152
- * Added `strict` flag to tsconfig
153
-
154
- 2019-05-05 Saša Jovanić <sasa@simplify.ba>
155
- * Updated development dependencies to latest versions
156
- * Updated deep dependencies that have security issues
157
-
158
- 2019-05-05 Saša Jovanić <sasa@simplify.ba>
159
- * Released varsion 2.1.0
160
- * Merged PR1 - Renamed `main:jsnext` to `modules` - Thanks @NeoLegends (PR1/GH9)
161
- * Upraded various packages containing security vulnerabilities using `npm audit fix`
162
- * Upgraded Gulp to version 4 and all gulp tasks
163
- * Added Vatican City State (GH13)
164
- * `friendlyFormatIBAN` and `electronicFormatIBAN` will return `null` when non-string value is provided (GH15).
165
- * Fixed issue with `extractBIC` when argument is provided in lowercase (GH12).
166
-
167
- 2018-03-11 Saša Jovanić <sasa@simplify.ba>
168
- * Released version 2.0.0
169
- * BREAKING: `isValidIBAN` does not accept IBAN with `-` and ` ` any more - IBAN must be already in electronic format
170
- * `getCountrySpecifications` now returns all countries (ISO-3166-1 alpha-2 + `XK` - temporary country code for Kosovo) with `IBANRegistry` boolean property that indicates if country is in IBAN registry or not
171
- * `extractIBAN` now requires IBAN in electronic format
172
- * `isValidBIC` now also checks if Country exists
173
- * `extractBIC` also returns property `countryCode`
174
- * Added `tslint` as development dependency
175
-
176
- 2018-02-13 Saša Jovanić <sasa@simplify.ba>
177
- * Released version 1.6.0
178
- * Fixed link to latest IBAN registry PDF document
179
- * Fixed validation for Costa Rica (it has 18 digits now, not 17)
180
- * Added Republic of Belarus
181
- * Added Iraq
182
- * Renamed `Palestinian teritories` to `State of Palestine`, as in IBAN registry
183
- * Added El Salvador
184
- * Updated develpoment dependencies
185
- * `ExtractIBANResult` now also contains `iban` that represents IBAN electronic format
186
- * `electronicFormatIBAN` now removes only spaces and dashes, not the other unicode characters
187
-
188
- 2017-11-15 Saša Jovanić <sasa@simplify.ba>
189
- * Released version 1.5.1
190
- * Fixed mistake in BIC validation regexp when brach code is present (GH-5)
191
- * Added node.js 9 to TravisCI
192
-
193
- 2017-10-10 Saša Jovanić <sasa@simplify.ba>
194
- * Released version 1.5.0
195
- * Fixed typos in source code and documentation (GH-4)
196
-
197
- 2017-10-05 Saša Jovanić <sasa@simplify.ba>
198
- * Changed documentation theme to `docdash`
199
- * Fixed links in README to avoid broken links in documentation
200
- * Updated `coverals` package
201
-
202
- 2017-10-05 Saša Jovanić <sasa@simplify.ba>
203
- * Released version 1.4.0
204
- * Added code of conduct
205
- * Updated mocha development dependency to 4.0
206
- * Added contribution guide
207
- * Updated JSDoc to latest version
208
- * Added issue and pull request template
209
-
210
- 2017-08-23 Saša Jovanić <sasa@simplify.ba>
211
- * Now using @types - typings removed
212
-
213
- 2017-08-22 Saša Jovanić <sasa@simplify.ba>
214
- * Updated development dependencies
215
- * Added node version 8 to TravisCI tests
216
-
217
- 2017-03-09 Saša Jovanić <sasa@simplify.ba>
218
- * Released version 1.3.0
219
- * Fixed `jsnext:main` file output
220
- * Fixed problem with BIC/SWIFT validation when branch code is part of BIC/SWIFT
221
- * extractBIC will return `branchCode` as '619' (primary office) if branch code in not part of BIC/SWIFT number
222
- * Fixed README file
223
- * Updated development dependencies
224
-
225
- 2017-02-04 Saša Jovanić <sasa@simplify.ba>
226
- * Released version 1.2.0
227
- * Added BIC/SWIFT validation
228
- * Added BIC/SWIFT extraction
229
- * Updated TypeScript definitions
230
-
231
- 2017-01-29 Saša Jovanić <sasa@simplify.ba>
232
- * Removed testing on Node 4 and 5 in TravisCI and added testing on 7
233
- * Updated dev dependencies
234
- * Removed TSLint deprecations
235
- * Fixed ducumentation
236
-
237
- 2016-08-30 Saša Jovanić <sasa@simplify.ba>
238
- * Removed CodeCov codes
239
- * Added Coveralls badge and integration
240
- * Added Dependency CI badge
241
-
242
- 2016-08-27 Saša Jovanić <sasa@simplify.ba>
243
- * Released version 1.1.0
244
- * Added Sao Tome And Principe (ST)
245
- * Added Saint Lucia (LC)
246
- * Added Aland Islands (AX)
247
- * Added French Guyana (GF)
248
- * Added Guadeloupe (GP)
249
- * Added Martinique (MQ)
250
- * Added Reunion (RE)
251
- * Added French Polynesia (PF)
252
- * Added French Southern Territories (TF)
253
- * Added Mayotte (YT)
254
- * Added New Caledonia (NC)
255
- * Added Saint Barthelemy (BL)
256
- * Added Saint Martin (MF)
257
- * Added Saint Pierre et Miquelon (PM)
258
- * Added Wallis and Futuna Islands (WF)
259
- * Added Seychelles (SC)
260
- * Fixed Republic of Azerbaijan and Jordan regexps
261
- * Fixed some of the country names
262
- * Added Node 6 to Travis CI
263
- * Added Codecov to Travis CI config file
264
- * Added this ChangeLog
265
- * Updated development dependencies and typings
266
- * Removed old script that used to retrive IBAN countries and codes from Wikipedia