Fixed config merge

This commit is contained in:
Klemek
2019-06-23 14:44:32 +02:00
parent 55e258e093
commit f2bd0ec10e
3 changed files with 19 additions and 1 deletions
+4
View File
@@ -10,6 +10,10 @@ const fs = require('fs');
const merge = (ref, src) => {
if (typeof ref !== typeof src) {
return ref;
} else if (ref.length && !src.length) {
return ref;
} else if (ref.length && src.length) {
return src;
} else if (typeof ref === 'object') {
const out = {};
Object.keys(ref).forEach((key) => out[key] = merge(ref[key], src[key]));