Add package.json dependecis parsing#59
Open
SzymonDrosdzol wants to merge 3 commits into
Open
Conversation
| pkgs[key] = current | ||
| continue | ||
| } | ||
| pkgs[key] = mergeDependencyDetails(existing, current) |
Collaborator
There was a problem hiding this comment.
Is there a reason why only using append here would be wrong?
Author
There was a problem hiding this comment.
I thought I understood the question, but the more Iook at it the less I see any ways that append could make it simpler while preserving the logic.
Can you give an example?
Collaborator
There was a problem hiding this comment.
I guess a better questions would be:
- Can the code be refactored to directly modify
pkgs[key].depGroups? - Is using
slices.Clone,slices.Sort(merged)andslices.Compact(merged)actually needed?
Author
There was a problem hiding this comment.
- refactored
len(d.depGroups) == 0to a separate function to better convey its purpose - Added some comments
- Removed slices calls
Please verify @alessandro-Doyensec
Member
|
lgtm 🚀 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds parsing dependencies from
package.jsonfiles.Opt-in, needs to be enabled in config. Full command: