Skip to content

Commit

Permalink
Edit nextNetworks
Browse files Browse the repository at this point in the history
  • Loading branch information
pablomendezroyo committed Jul 10, 2024
1 parent 14d7754 commit 16ee77c
Showing 1 changed file with 4 additions and 18 deletions.
22 changes: 4 additions & 18 deletions packages/dockerCompose/src/userSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,26 +194,12 @@ export function applyUserSettings(
// TODO: use docker compose merge to automatically merge these dappnode docker compose properties
// see https://github.com/dappnode/DNP_DAPPMANAGER/issues/1983
const nextNetworks = mergeWith(
{},
networks,
userSetNetworks,
(objValue, srcValue) => {
if (isArray(objValue) && isArray(srcValue)) {
return union(objValue, srcValue);
} else if (isObject(objValue) && isObject(srcValue)) {
return mergeWith(
{},
objValue,
srcValue,
(innerObjValue, innerSrcValue) => {
if (isArray(innerObjValue) && isArray(innerSrcValue)) {
return union(innerObjValue, innerSrcValue);
}
return undefined; // Use default merging behavior for other types
}
);
}
return undefined; // Use default merging behavior for other types
(value1, value2) => {
return mergeWith(value1, value2, (subvalue1, subvalue2) => {
return union(subvalue1, subvalue2);
});
}
);

Expand Down

0 comments on commit 16ee77c

Please sign in to comment.