Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ibantools

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ibantools - npm Package Compare versions

Comparing version 4.3.8 to 4.3.9

33

build/ibantools.js

@@ -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,

2

package.json
{
"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": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc