fix: compilation

This commit is contained in:
Ibrahima G. Coulibaly
2024-06-25 03:13:24 +01:00
parent cfe0d324fe
commit 4d1ba98592
2 changed files with 18 additions and 35 deletions

View File

@@ -11,7 +11,7 @@ export const compute = (
extractionType: NumberExtractionType,
printRunningSum: boolean,
separator: string
) => {
): string => {
let numbers: number[] = [];
if (extractionType === 'smart') {
numbers = getAllNumbers(input);
@@ -22,8 +22,7 @@ export const compute = (
.filter((part) => !isNaN(Number(part)) && part.trim() !== '')
.map(Number);
}
return numbers.reduce(
(previousValue, currentValue) => previousValue + currentValue,
0
);
return numbers
.reduce((previousValue, currentValue) => previousValue + currentValue, 0)
.toString();
};