aboutsummaryrefslogtreecommitdiff
path: root/src/modules/commerce
diff options
context:
space:
mode:
authorST-DDT <[email protected]>2023-10-21 08:58:18 +0200
committerGitHub <[email protected]>2023-10-21 06:58:18 +0000
commitf222448cabedee3e8ac4f64f8003df0954de2913 (patch)
treef78bc0a84b356f4a91292e33ee34b47c889f45db /src/modules/commerce
parent85403819af2c47e4f9d24c66ca34c844a6151bdb (diff)
downloadfaker-f222448cabedee3e8ac4f64f8003df0954de2913.tar.xz
faker-f222448cabedee3e8ac4f64f8003df0954de2913.zip
infra(unicorn): prefer-number-properties (#2452)
Diffstat (limited to 'src/modules/commerce')
-rw-r--r--src/modules/commerce/index.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/modules/commerce/index.ts b/src/modules/commerce/index.ts
index 2464af03..18147dcb 100644
--- a/src/modules/commerce/index.ts
+++ b/src/modules/commerce/index.ts
@@ -382,7 +382,7 @@ export class CommerceModule {
const [group, groupRules] =
this.faker.helpers.objectEntry(ISBN_LENGTH_RULES);
const element = this.faker.string.numeric(8);
- const elementValue = parseInt(element.slice(0, -1));
+ const elementValue = Number.parseInt(element.slice(0, -1));
const registrantLength = groupRules.find(
([rangeMaximum]) => elementValue <= rangeMaximum
@@ -401,7 +401,7 @@ export class CommerceModule {
let checksum = 0;
for (let i = 0; i < variant - 1; i++) {
const weight = variant === 10 ? i + 1 : i % 2 ? 3 : 1;
- checksum += weight * parseInt(isbn[i]);
+ checksum += weight * Number.parseInt(isbn[i]);
}
checksum = variant === 10 ? checksum % 11 : (10 - (checksum % 10)) % 10;