-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
feat - Add a syntax for adjusting merge behavior without matching #152
Conversation
@dennisoelkers Can you provide more complex configuration to test against for you |
@bebraw: If I understood correctly, a possible use case would be merging two disjunct arrays:
(Runnable example in https://runkit.com/embed/wibzpdx8gmug) It returns an empty array as well and should return the superset of both arrays instead. |
@dennisoelkers Thanks. That's a good example and I see the use case now. In the current logic it's applying append/prepend/replace against the same level within the object but I see this has to be expanded. One interesting option might be to support syntax like |
@dennisoelkers I pushed an experimental syntax to the PR after thinking about the issue for a while. Now there are things like |
Codecov Report
@@ Coverage Diff @@
## develop #152 +/- ##
===========================================
- Coverage 98.47% 98.17% -0.31%
===========================================
Files 6 6
Lines 197 219 +22
Branches 55 60 +5
===========================================
+ Hits 194 215 +21
- Misses 3 4 +1
Continue to review full report at Codecov.
|
@dennisoelkers FYI, I just rebased the PR so it merges well. I think it's going to need better naming somehow ( |
mergeRules
Hey @bebraw, do you have any ETA for this? Thanks! |
Hey @bebraw, any updates on this? |
@just-jeb This one is good for a look. As the implementation is quite simple, I wonder if I missed something obvious. Likely a couple more tests wouldn't hurt but API-wise it's definitely better now. Note that I might have to migrate away from Travis as they've added significant restrictions for open source usage so it's possible the CI task won't complete. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Included to |
@dennisoelkers This is my go at fixing your issue. I set up tests based on your code and fixed one of the problems.
I think the
resolve.extensions
case needs a bit more to go with it. Do you have more complex configuration there in your case? The trivial way to solve it would be to useresolve: 'replace'
but that would work only for this specific case. Now the design is that it's going to append extensions only if a sibling matches which sort of makes sense logically.Closes #151.