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

is-valid-nip

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-valid-nip - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

13

dist/cjs/index.js
"use strict";
exports.__esModule = true;
Object.defineProperty(exports, "__esModule", { value: true });
var weights = [6, 5, 7, 2, 3, 4, 5, 6, 7];

@@ -16,7 +16,6 @@ function isValidNIP(rawNip) {

var sum = 0;
for (var position = 0; position < weights.length; position += 1) {
var weight = weights[position];
var digit = parseInt(nip[position], 10);
weights.forEach(function (weight, position) {
var digit = Number(nip[position]);
sum += weight * digit;
}
});
var checksum = sum % 11;

@@ -26,4 +25,4 @@ if (checksum === 10) {

}
return checksum === parseInt(nip[9], 10);
return checksum === Number(nip[9]);
}
exports["default"] = isValidNIP;
exports.default = isValidNIP;

@@ -14,7 +14,6 @@ var weights = [6, 5, 7, 2, 3, 4, 5, 6, 7];

var sum = 0;
for (var position = 0; position < weights.length; position += 1) {
var weight = weights[position];
var digit = parseInt(nip[position], 10);
weights.forEach(function (weight, position) {
var digit = Number(nip[position]);
sum += weight * digit;
}
});
var checksum = sum % 11;

@@ -24,3 +23,3 @@ if (checksum === 10) {

}
return checksum === parseInt(nip[9], 10);
return checksum === Number(nip[9]);
}
{
"name": "is-valid-nip",
"version": "1.2.0",
"version": "1.2.1",
"description": "Check if a number is a valid Numer Identyfikacji Podatkowej (NIP)",

@@ -5,0 +5,0 @@ "main": "dist/cjs/index.js",

@@ -18,7 +18,6 @@ const weights = [6, 5, 7, 2, 3, 4, 5, 6, 7];

let sum = 0;
for (let position = 0; position < weights.length; position += 1) {
const weight = weights[position];
const digit = parseInt(nip[position], 10);
weights.forEach((weight, position) => {
const digit = Number(nip[position]);
sum += weight * digit;
}
});

@@ -31,3 +30,3 @@ const checksum = sum % 11;

return checksum === parseInt(nip[9], 10);
return checksum === Number(nip[9]);
}
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