Comparing version 4.3.8 to 4.3.9
@@ -11,3 +11,3 @@ /*! | ||
* @module ibantools | ||
* @version 4.3.8 | ||
* @version 4.3.9 | ||
* @license MPL-2.0 | ||
@@ -781,32 +781,2 @@ * @preferred | ||
/** | ||
* Dutch (NL) BBAN check | ||
* | ||
* @ignore | ||
*/ | ||
var checkDutchBBAN = function (bban) { | ||
if (bban === '') { | ||
return false; | ||
} | ||
var weights = [10, 9, 8, 7, 6, 5, 4, 3, 2, 1]; | ||
var toCheckAccount = bban.substring(4, 14); | ||
if (toCheckAccount.startsWith('000')) { | ||
return true; | ||
} | ||
if (toCheckAccount.startsWith('00')) { | ||
return false; | ||
} | ||
var sum = toCheckAccount | ||
.split('') | ||
.map(function (value, index) { | ||
if (value === '0' && index === 0) { | ||
return 0; | ||
} | ||
var number = parseInt(value, 10); | ||
var weight = weights[index]; | ||
return number * weight; | ||
}) | ||
.reduce(function (a, b) { return a + b; }); | ||
return sum % 11 === 0; | ||
}; | ||
/** | ||
* Set custom BBAN validation function for country. | ||
@@ -1464,3 +1434,2 @@ * | ||
bban_regexp: '^[A-Z]{4}[0-9]{10}$', | ||
bban_validation_func: checkDutchBBAN, | ||
IBANRegistry: true, | ||
@@ -1467,0 +1436,0 @@ SEPA: true, |
@@ -11,3 +11,3 @@ /*! | ||
* @module ibantools | ||
* @version 4.3.8 | ||
* @version 4.3.9 | ||
* @license MPL-2.0 | ||
@@ -766,32 +766,2 @@ * @preferred | ||
/** | ||
* Dutch (NL) BBAN check | ||
* | ||
* @ignore | ||
*/ | ||
var checkDutchBBAN = function (bban) { | ||
if (bban === '') { | ||
return false; | ||
} | ||
var weights = [10, 9, 8, 7, 6, 5, 4, 3, 2, 1]; | ||
var toCheckAccount = bban.substring(4, 14); | ||
if (toCheckAccount.startsWith('000')) { | ||
return true; | ||
} | ||
if (toCheckAccount.startsWith('00')) { | ||
return false; | ||
} | ||
var sum = toCheckAccount | ||
.split('') | ||
.map(function (value, index) { | ||
if (value === '0' && index === 0) { | ||
return 0; | ||
} | ||
var number = parseInt(value, 10); | ||
var weight = weights[index]; | ||
return number * weight; | ||
}) | ||
.reduce(function (a, b) { return a + b; }); | ||
return sum % 11 === 0; | ||
}; | ||
/** | ||
* Set custom BBAN validation function for country. | ||
@@ -1448,3 +1418,2 @@ * | ||
bban_regexp: '^[A-Z]{4}[0-9]{10}$', | ||
bban_validation_func: checkDutchBBAN, | ||
IBANRegistry: true, | ||
@@ -1451,0 +1420,0 @@ SEPA: true, |
{ | ||
"name": "ibantools", | ||
"version": "4.3.8", | ||
"version": "4.3.9", | ||
"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,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
126222
3695