mirror of
https://github.com/tridactyl/tridactyl.git
synced 2026-09-10 07:16:33 -04:00
fix: ensure a nake object without built-in method
and remove non-necessary prototype chain
This commit is contained in:
parent
98b92d562a
commit
e5619e8ef1
|
|
@ -1956,8 +1956,8 @@ function setDeepProperty(obj, value, target) {
|
|||
* Merges two objects and any child objects they may have
|
||||
*/
|
||||
export function mergeDeep(o1, o2) {
|
||||
if (o1 === null) return Object.assign({}, o2)
|
||||
const r = Array.isArray(o1) ? o1.slice() : Object.create(o1)
|
||||
if (o1 === null) return o(o2)
|
||||
const r = Array.isArray(o1) ? o1.slice() : o({})
|
||||
Object.assign(r, o1, o2)
|
||||
if (o2 === undefined) return r
|
||||
Object.keys(o1)
|
||||
|
|
|
|||
Loading…
Reference in a new issue