The biggest difficulty deep merge libraries run into is figuring out which properties of an object should be recursively iterated over.
This module contains the algorithm used by deepmerge
.
isMergeableObject(null) // => false
isMergeableObject({}) // => true
isMergeableObject(new RegExp('wat')) // => false
isMergeableObject(undefined) // => false
isMergeableObject(new Object()) // => true
isMergeableObject(new Date()) // => false
isMergeableObject(someReactElement) // => false