is-valid-nip
Advanced tools
Comparing version 1.2.0 to 1.2.1
"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]); | ||
} |
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
7866
118