mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 00:33:41 -05:00
13 lines
322 B
JavaScript
13 lines
322 B
JavaScript
|
function merge(settings, defaults) {
|
||
|
for (const [key, value] of Object.entries(settings)) {
|
||
|
if ((typeof(value) === "object") && !(value instanceof Array)) {
|
||
|
defaults[key] = merge(value, defaults[key] || {});
|
||
|
} else {
|
||
|
defaults[key] = value;
|
||
|
}
|
||
|
}
|
||
|
return defaults;
|
||
|
}
|
||
|
|
||
|
module.exports = { merge };
|