Skip to content

Commit d26a992

Browse files
Fix build error
1 parent 41bc5fc commit d26a992

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

frontend/src/views/HomeView.vue

+6-2
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,12 @@ function checkIBAN(iban: string): boolean {
149149
if (!/([a-zA-Z]{2}[0-9]{2})([a-zA-Z]{4}[0-9]{10})/.test(iban)){ // Check if the general format is OK
150150
return false;
151151
}
152-
const numericIban = (iban.slice(4) + iban.slice(0, 4)).replace(/[A-Z]/g, char => (char.charCodeAt(0) - 55).toString()); // 11-test
153-
const remainder = numericIban.split('').reduce((acc, digit) => (acc + digit) % 97, 0);
152+
const numericIban = (iban.slice(4) + iban.slice(0, 4))
153+
.replace(/[A-Z]/g, char => (char.charCodeAt(0) - 55).toString()); // 11-test
154+
const remainder = numericIban
155+
.split('')
156+
.map((acc, digit) => (Number.parseInt(acc), digit))
157+
.reduce((acc, digit) => (acc + digit) % 97, 0);
154158
return remainder === 1;
155159
}
156160

0 commit comments

Comments
 (0)