Skip to content
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

Fix to prevent errors occuring when merging non-map value #20

Merged
merged 1 commit into from
Mar 27, 2024

Conversation

itoooo
Copy link
Contributor

@itoooo itoooo commented Mar 26, 2024

In situation overriding non-map value to a map, the merge-with function throws an exception like below:

(proton.core/deep-merge {:foo 1} {:foo {:bar :buzz}})
Execution error (IllegalArgumentException) at proton.core$deep_merge$m__4759/doInvoke (core.cljc:196).
contains? not supported on type: java.lang.Long

I assume the expected behavior is returning {:foo {:bar :buzz}} right?

In this PR, the deep-merge fn gets fix to pass only map values to the merge-with fn.
I also confirmed the tests passed.

@itoooo itoooo requested a review from federkasten March 26, 2024 11:54
Copy link

codecov bot commented Mar 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.10%. Comparing base (6133961) to head (8ceb204).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #20      +/-   ##
==========================================
+ Coverage   94.40%   95.10%   +0.69%     
==========================================
  Files           9        9              
  Lines         286      286              
  Branches        4        3       -1     
==========================================
+ Hits          270      272       +2     
+ Misses         12       11       -1     
+ Partials        4        3       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@federkasten federkasten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🙆‍♂️

@federkasten federkasten force-pushed the feature/fix-deep-merge branch from bd5bbbd to 8ceb204 Compare March 27, 2024 03:45
@federkasten
Copy link
Member

Successfully passed the tests by rebasing to #21. Thank you for your review! @itoooo

@federkasten federkasten merged commit 4ed61ff into master Mar 27, 2024
35 checks passed
@federkasten federkasten deleted the feature/fix-deep-merge branch March 27, 2024 03:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants