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

is-valid-pesel

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-valid-pesel - 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 = [1, 3, 7, 9, 1, 3, 7, 9, 1, 3];

@@ -16,10 +16,9 @@ function isValidPESEL(rawPesel) {

var sum = 0;
for (var position = 0; position < weights.length; position += 1) {
var weight = weights[position];
var digit = parseInt(pesel[position], 10);
weights.forEach(function (weight, position) {
var digit = Number(pesel[position]);
sum += weight * digit;
}
});
var checksum = (10 - (sum % 10)) % 10;
return checksum === parseInt(pesel[10], 10);
return checksum === Number(pesel[10]);
}
exports["default"] = isValidPESEL;
exports.default = isValidPESEL;

@@ -14,9 +14,8 @@ var weights = [1, 3, 7, 9, 1, 3, 7, 9, 1, 3];

var sum = 0;
for (var position = 0; position < weights.length; position += 1) {
var weight = weights[position];
var digit = parseInt(pesel[position], 10);
weights.forEach(function (weight, position) {
var digit = Number(pesel[position]);
sum += weight * digit;
}
});
var checksum = (10 - (sum % 10)) % 10;
return checksum === parseInt(pesel[10], 10);
return checksum === Number(pesel[10]);
}
{
"name": "is-valid-pesel",
"version": "1.2.0",
"version": "1.2.1",
"description": "Check if a number is a valid PESEL",

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

@@ -18,11 +18,10 @@ const weights = [1, 3, 7, 9, 1, 3, 7, 9, 1, 3];

let sum = 0;
for (let position = 0; position < weights.length; position += 1) {
const weight = weights[position];
const digit = parseInt(pesel[position], 10);
weights.forEach((weight, position) => {
const digit = Number(pesel[position]);
sum += weight * digit;
}
});
const checksum = (10 - (sum % 10)) % 10;
return checksum === parseInt(pesel[10], 10);
return checksum === Number(pesel[10]);
}
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