forked from danielsdeleo/deep_merge
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge nil values or keep the original via an option
For some people, it's unexpected that explicitly merging in a nil will not overwrite an existing value. `DeepMerge::deep_merge({:a => nil}, {:a => 1})` Currently, we retain the 1 value. My expectation is we'd get a nil value. Since changing this is a change in behavior, and possibly not desirable, I'm exposing an option to opt-in to this new behavior. Note, this is related to danielsdeleo#20 and can be confusing to see the difference. This commit handles merging a nil value into an existing destination via an option. PR danielsdeleo#20 handles NOT merging a value into an already nil destination.
- Loading branch information
Showing
3 changed files
with
22 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters