15 lines
383 B
JavaScript
15 lines
383 B
JavaScript
|
export const mergeConfigFiles = (...files) => {
|
||
|
const merged = {};
|
||
|
for (const file of files) {
|
||
|
for (const [key, values] of Object.entries(file)) {
|
||
|
if (merged[key] !== undefined) {
|
||
|
Object.assign(merged[key], values);
|
||
|
}
|
||
|
else {
|
||
|
merged[key] = values;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
return merged;
|
||
|
};
|