diff --git a/js/utils.js b/js/utils.js index d3c93175282d38bc4a5fc511c76b2baee1e69728..3b863894535094313d412bbfb74b2829e759b583 100644 --- a/js/utils.js +++ b/js/utils.js @@ -365,25 +365,7 @@ function sortArrayByArray(sorted, unsorted, key) { * @param {object} source */ function deepAssign(target, source) { - function isObject(o) { - return (o !== undefined && o !== null && typeof o === 'object' && !Array.isArray(o)); - } - - if (isObject(target) && isObject(source)) { - for (const key in source) { - if (!source.hasOwnProperty(key)) { continue; } - if (isObject(source[key])) { - if (!target.hasOwnProperty(key) || !isObject(target[key])) { - target[key] = {}; - } - deepAssign(target[key], source[key]); - } else { - Object.assign(target, { - [key]: source[key] - }); - } - } - } + _.assign(target, _.cloneDeep(source)); } /**