-
Notifications
You must be signed in to change notification settings - Fork 216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect behavior when trying to use customMerge with booleans #170
Comments
Looks like a bug caused by this line: Line 47 in 8209fc6
It's checking if the value in the target is falsey, when it should be checking to see if the property doesn't exist in the target. It would be great if someone could contribute a failing test. The new test should probably use |
Actually, I think this could be fixed by a tweak to #164... |
A failing test would still be nice though. |
I assume this will also fail for other falsey things like |
Yup. It's a pretty dumb bug. |
I would like to utilize deepmerge to combine two objects that only have boolean keys in a way that keeps all booleans that were true in the destination object to remain true after the merge. Code is below:
What I've found is that any boolean keys of the destination object that are false before the merge are never logged in the customMerge function, and end up as
{}
after the merge is complete.Here is the output after executing this code:
Expected output is:
Using deepmerge 4.1.1 and is-mergeable-object 1.1.1
The text was updated successfully, but these errors were encountered: