Fixed install script (bis)

This commit is contained in:
Clément GOUIN
2019-06-19 13:44:02 +02:00
parent 7bfdbbf511
commit b8d88eb00c
8 changed files with 208 additions and 233 deletions
+16
View File
@@ -0,0 +1,16 @@
const refConfig = require('./default_config.json');
const srcConfig = require('../config.json');
const merge = function (ref, src) {
if (typeof ref !== typeof src) {
return ref;
} else if (typeof ref === 'object') {
const out = {};
Object.keys(ref).forEach(key => out[key] = merge(ref[key], src[key]));
return out;
} else {
return src;
}
};
module.exports = merge(refConfig, srcConfig);