You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently a new object is always created so this does not hold. Not sure if this is an unreasonable request or out of scope, I've had a look at Lodash and Ramda but can't seem to find this anywhere.
The text was updated successfully, but these errors were encountered:
That would put deepmerge in the awkward position of having to do equality checks on everything - right now, it only compares types before copying.
Equality checks are difficult, because some people would expect object identity to be used for equality checks ({} === {} should be false) and others would only want object properties or array elements of certain primitive values compared.
I would rather push the library in the direction of always cloning everything, ala #72. It would make more sense than the current default behavior (creating a new root object, but mutating child objects on the destination object).
That way users could rely on always getting a full copy, and wouldn't have to reason about partial recursive clones.
If you do need that behavior, then I think you would be better off finding a recursive-object-equality-checking library that checks equality how you expect and doing that check before calling merge.
Ok perhaps I can use a deepEqual utility first and then do a deepMerge. Not sure about the performance implications but I can see how this could be an awkward mix for this library. Thanks for the prompt reply!
I'm looking for this behaviour:
Currently a new object is always created so this does not hold. Not sure if this is an unreasonable request or out of scope, I've had a look at Lodash and Ramda but can't seem to find this anywhere.
The text was updated successfully, but these errors were encountered: