aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorST-DDT <[email protected]>2023-10-23 08:52:10 +0200
committerGitHub <[email protected]>2023-10-23 06:52:10 +0000
commitbd197037c02df63bd81b6289ecbd8769111ae7b9 (patch)
treeee361f5ae9f5d144e18ab9306f55d929fd4d5ffa
parent2ba232e0ebaa4a48ed6df6f7349a00d4a7097608 (diff)
downloadfaker-bd197037c02df63bd81b6289ecbd8769111ae7b9.tar.xz
faker-bd197037c02df63bd81b6289ecbd8769111ae7b9.zip
chore: substrings of length one (#2496)
-rw-r--r--scripts/apidoc/typedoc.ts2
-rw-r--r--src/modules/helpers/luhn-check.ts2
2 files changed, 2 insertions, 2 deletions
diff --git a/scripts/apidoc/typedoc.ts b/scripts/apidoc/typedoc.ts
index 28a3db85..4a39bd33 100644
--- a/scripts/apidoc/typedoc.ts
+++ b/scripts/apidoc/typedoc.ts
@@ -154,7 +154,7 @@ export function extractModuleName(module: DeclarationReflection): string {
export function extractModuleFieldName(module: DeclarationReflection): string {
const moduleName = extractModuleName(module);
- return moduleName.substring(0, 1).toLowerCase() + moduleName.substring(1);
+ return moduleName[0].toLowerCase() + moduleName.substring(1);
}
export const MISSING_DESCRIPTION = 'Missing';
diff --git a/src/modules/helpers/luhn-check.ts b/src/modules/helpers/luhn-check.ts
index ba68b41d..42fbe1a5 100644
--- a/src/modules/helpers/luhn-check.ts
+++ b/src/modules/helpers/luhn-check.ts
@@ -28,7 +28,7 @@ function luhnChecksum(str: string): number {
let sum = 0;
let alternate = false;
for (let i = str.length - 1; i >= 0; i--) {
- let n = Number.parseInt(str.substring(i, i + 1));
+ let n = Number.parseInt(str[i]);
if (alternate) {
n *= 2;
if (n > 9) {