diff --git a/src/human.ts b/src/human.ts index f60718b8..ed5706d9 100644 --- a/src/human.ts +++ b/src/human.ts @@ -29,13 +29,9 @@ function mergeDeep(...objects) { Object.keys(obj || {}).forEach((key) => { const pVal = prev[key]; const oVal = obj[key]; - if (Array.isArray(pVal) && Array.isArray(oVal)) { - prev[key] = pVal.concat(...oVal); - } else if (isObject(pVal) && isObject(oVal)) { - prev[key] = mergeDeep(pVal, oVal); - } else { - prev[key] = oVal; - } + if (Array.isArray(pVal) && Array.isArray(oVal)) prev[key] = pVal.concat(...oVal); + else if (isObject(pVal) && isObject(oVal)) prev[key] = mergeDeep(pVal, oVal); + else prev[key] = oVal; }); return prev; }, {});