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

feat: sort components #624

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

feat: sort components #624

wants to merge 1 commit into from

Conversation

cerrussell
Copy link
Contributor

Added sorting of components.

Signed-off-by: Caroline Russell <caroline@appthreat.dev>
@cerrussell cerrussell requested a review from prabhu October 9, 2023 22:47
@@ -631,6 +631,7 @@ export function listComponents(
const compMap = {};
const isRootPkg = ptype === "npm";
if (Array.isArray(pkg)) {
pkg.sort((a, b) => a.name.localeCompare(b.name));
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe sort by purl which also includes group? Also there could be a comparator function used somewhere

@cerrussell
Copy link
Contributor Author

@prabhu I looked at the componentSorter in utils, and that is ok, but it ends up sorting by group, where available. Although this makes some sense, it helps very little as a user trying to locate a specific package on the list - and that is the problem I sought to address.

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.

None yet

2 participants