use for-of statements to replace for and for-in

This commit is contained in:
MaysWind
2025-09-09 23:48:42 +08:00
parent c75a902d84
commit 34c5a1750e
50 changed files with 368 additions and 460 deletions
+7 -7
View File
@@ -96,7 +96,7 @@ export class NumeralSystem implements TypeAndName {
return '';
}
return this.allDigits[digit];
return this.allDigits[digit] as string;
}
public parseInt(value: string): number {
@@ -136,11 +136,11 @@ export class NumeralSystem implements TypeAndName {
let result = '';
for (let i = 0; i < value.length; i++) {
const ch = value[i];
const ch = value.charAt(i);
if (NumeralSystem.WesternArabicNumerals.isDigit(ch)) {
const digit = NumeralSystem.WesternArabicNumerals.digitsToWesternArabic[ch];
result += this.allDigits[digit];
const digit = NumeralSystem.WesternArabicNumerals.digitsToWesternArabic[ch] as number;
result += this.allDigits[digit] as string;
} else {
result += ch;
}
@@ -157,11 +157,11 @@ export class NumeralSystem implements TypeAndName {
let result = '';
for (let i = 0; i < value.length; i++) {
const ch = value[i];
const ch = value.charAt(i);
if (this.isDigit(ch)) {
const digit = this.digitsToWesternArabic[ch];
result += NumeralSystem.WesternArabicNumerals.allDigits[digit];
const digit = this.digitsToWesternArabic[ch] as number;
result += NumeralSystem.WesternArabicNumerals.allDigits[digit] as string;
} else {
result += ch;
}