aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/iban.ts14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/iban.ts b/src/iban.ts
index b608357e..2e67f281 100644
--- a/src/iban.ts
+++ b/src/iban.ts
@@ -30,21 +30,13 @@ export = {
pattern10: ['01', '02', '03', '04', '05', '06', '07', '08', '09'],
pattern100: ['001', '002', '003', '004', '005', '006', '007', '008', '009'],
toDigitString: (str: string): string =>
- str.replace(
- /[A-Z]/gi,
- (match) =>
- // TODO @Shinigami92 2022-01-13: This needs to be converted to string
- // @ts-expect-error
- match.toUpperCase().charCodeAt(0) - 55
+ str.replace(/[A-Z]/gi, (match) =>
+ String(match.toUpperCase().charCodeAt(0) - 55)
),
mod97: (digitStr: string): number => {
let m = 0;
for (let i = 0; i < digitStr.length; i++) {
- m =
- (m * 10 +
- // @ts-expect-error: We need to convert this properly
- (digitStr[i] | 0)) %
- 97;
+ m = (m * 10 + +digitStr[i]) % 97;
}
return m;
},