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

44
.idea/workspace.xml generated
View File

@@ -4,24 +4,8 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="b30e2810-c4c1-4aad-b134-794e52cc1c7d" name="Changes" comment="feat: string to morse">
<change afterPath="$PROJECT_DIR$/src/components/options/SimpleRadio.tsx" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/pages/number/index.ts" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/pages/number/sum/index.tsx" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/pages/number/sum/meta.ts" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/pages/number/sum/service.ts" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/pages/number/sum/sum.service.test.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.eslintrc" beforeDir="false" afterPath="$PROJECT_DIR$/.eslintrc" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/scripts/create-tool.mjs" beforeDir="false" afterPath="$PROJECT_DIR$/scripts/create-tool.mjs" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/components/options/ColorSelector.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/src/components/options/ColorSelector.tsx" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/components/options/RadioWithTextField.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/src/components/options/RadioWithTextField.tsx" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/components/options/ToolOptionGroups.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/src/components/options/ToolOptionGroups.tsx" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/config/uiConfig.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/config/uiConfig.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/pages/home/index.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/src/pages/home/index.tsx" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/pages/string/split/index.tsx" beforeDir="false" afterPath="$PROJECT_DIR$/src/pages/string/split/index.tsx" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/pages/string/to-morse/meta.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/pages/string/to-morse/meta.ts" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/tools/index.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/tools/index.ts" afterDir="false" />
<list default="true" id="b30e2810-c4c1-4aad-b134-794e52cc1c7d" name="Changes" comment="feat: sum numbers init">
<change beforePath="$PROJECT_DIR$/src/pages/number/sum/service.ts" beforeDir="false" afterPath="$PROJECT_DIR$/src/pages/number/sum/service.ts" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -191,15 +175,7 @@
<workItem from="1719166718305" duration="1783000" />
<workItem from="1719168519203" duration="17675000" />
<workItem from="1719197816332" duration="1453000" />
<workItem from="1719273044735" duration="8300000" />
</task>
<task id="LOCAL-00002" summary="feat: initial commit">
<option name="closed" value="true" />
<created>1718820618078</created>
<option name="number" value="00002" />
<option name="presentableId" value="LOCAL-00002" />
<option name="project" value="LOCAL" />
<updated>1718820618078</updated>
<workItem from="1719273044735" duration="8486000" />
</task>
<task id="LOCAL-00003" summary="feat: initial commit">
<option name="closed" value="true" />
@@ -585,7 +561,15 @@
<option name="project" value="LOCAL" />
<updated>1719277679969</updated>
</task>
<option name="localTasksCounter" value="51" />
<task id="LOCAL-00051" summary="feat: sum numbers init">
<option name="closed" value="true" />
<created>1719281510362</created>
<option name="number" value="00051" />
<option name="presentableId" value="LOCAL-00051" />
<option name="project" value="LOCAL" />
<updated>1719281510362</updated>
</task>
<option name="localTasksCounter" value="52" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
@@ -606,7 +590,6 @@
<option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" />
<option name="CHECK_NEW_TODO" value="false" />
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
<MESSAGE value="chore: idea config" />
<MESSAGE value="feat: react helmet" />
<MESSAGE value="feat: tools normalized" />
<MESSAGE value="feat: search tools" />
@@ -631,7 +614,8 @@
<MESSAGE value="chore: ResultFooter" />
<MESSAGE value="feat: change color in png finished" />
<MESSAGE value="feat: string to morse" />
<option name="LAST_COMMIT_MESSAGE" value="feat: string to morse" />
<MESSAGE value="feat: sum numbers init" />
<option name="LAST_COMMIT_MESSAGE" value="feat: sum numbers init" />
</component>
<component name="XSLT-Support.FileAssociations.UIState">
<expand />

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();
};