mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-27 21:10:49 +00:00
4de9c98d2f
[settings] setup linting and fix all the violations GitOrigin-RevId: 321ecf0e8749a0481d61ad720baffe06089dc5cf
12 lines
315 B
JavaScript
12 lines
315 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 }
|