We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9206a10 commit ec4801dCopy full SHA for ec4801d
src/lib/isIdentityCard.js
@@ -16,18 +16,13 @@ const validators = {
16
8: 9,
17
9: 1,
18
10: 3,
19
- 11: 1,
+ 11: 0,
20
};
21
22
if (str != null && str.length === 11 && isInt(str, { allow_leading_zeroes: true })) {
23
const digits = str.split('').slice(0, -1);
24
- const sum = digits.reduce((acc, digit, index) => {
25
- if (index !== 10) {
26
- acc += (Number(digit) * weightOfDigits[index + 1]);
27
- }
28
-
29
- return acc;
30
- }, 0);
+ const sum = digits.reduce((acc, digit, index) =>
+ acc + (Number(digit) * weightOfDigits[index + 1]), 0);
31
32
const modulo = sum % 10;
33
const lastDigit = Number(str.charAt(str.length - 1));
0 commit comments