Skip to content

Commit 84580be

Browse files
authored
Merge pull request #2 from neryad/main
refactor: ♻️ Remove unnecessary variable from code
2 parents 9fd1077 + c8f3b6e commit 84580be

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ export function documentValidator(document: string): boolean {
1515
throw new Error('The provided document should have only 11 characters');
1616
}
1717

18-
const cedula = documentId;
19-
const c = cedula.split('');
18+
const c = documentId.split('');
2019
const v = [1, 2, 1, 2, 1, 2, 1, 2, 1, 2];
2120
let result = 0;
2221
let oc;
@@ -45,7 +44,7 @@ export function documentValidator(document: string): boolean {
4544

4645
if (uj < dp) {
4746
// eslint-disable-next-line prettier/prettier
48-
dp = (uj + 10) - dp;
47+
dp = uj + 10 - dp;
4948
}
5049

5150
const validationResult = c[10] == dp.toString();
@@ -62,4 +61,4 @@ function removeHyphens(documentId: string): string {
6261
return documentId.replace(/-/g, '');
6362
}
6463
return documentId;
65-
}
64+
}

0 commit comments

Comments
 (0)