diff --git a/scripts/apidoc/typedoc.ts b/scripts/apidoc/typedoc.ts index 28a3db8545a..4a39bd3344a 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 ba68b41d470..42fbe1a5485 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) {