TehShrike / deepmerge

A library for deep (recursive) merging of Javascript objects
MIT License
2.75k stars 216 forks source link

How to exclude some types, like: Element #126

Closed zhw2590582 closed 5 years ago

zhw2590582 commented 5 years ago
const resule = merge({
    obj: {}
}, {
    obj: document.querySelector('.app')
}, {
    isMergeableObject: function (source) {
        return source instanceof Element
    }
});

// {}, but not a Element,how to keep dom elements in the result?
console.log(resule.obj)