Skip to content

Commit 4257ed6

Browse files
Update shared/utils/currencyConversionPairs.ts
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 737c582 commit 4257ed6

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

shared/utils/currencyConversionPairs.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,8 +1173,17 @@ export const currencyConversionPairs = {
11731173
export const convertToCurrencyManagerFormat = (currencyConversionPair) => {
11741174
return currencyConversionPair.reduce(
11751175
(a, v) => ({
1176-
...a,
1177-
[v.input]: v.outputs.reduce((a, v) => ({ ...a, [v]: 1 }), {}),
1176+
export const convertToCurrencyManagerFormat = (currencyConversionPair) => {
1177+
const result = {};
1178+
for (const pair of currencyConversionPair) {
1179+
const outputs = {};
1180+
for (const output of pair.outputs) {
1181+
outputs[output] = 1;
1182+
}
1183+
result[pair.input] = outputs;
1184+
}
1185+
return result;
1186+
};
11781187
}),
11791188
{},
11801189
);

0 commit comments

Comments
 (0)