When a custom merger returns a result that is the same as in the currentObj we can aboirt addToResult since there are nothing more we have to do. And we don't have to flag that any changes have been done.
This is a partial fix to #40. With this addition a custom merger can be used to fullfill the requirements. Check the issue for the details.
In the if we check the merger to abort early, then we need to check if there is a mergeResult otherwise the last part, mergerResult === currentObj[key], would be true when the custom merger returns undefined and it is a value that is only available in otherObj and not currentObj.
When a custom merger returns a result that is the same as in the
currentObj
we can aboirtaddToResult
since there are nothing more we have to do. And we don't have to flag that any changes have been done.This is a partial fix to #40. With this addition a custom merger can be used to fullfill the requirements. Check the issue for the details.
In the
if
we check themerger
to abort early, then we need to check if there is amergeResult
otherwise the last part,mergerResult === currentObj[key]
, would be true when the custom merger returns undefined and it is a value that is only available inotherObj
and notcurrentObj
.