Skip to content

Commit

Permalink
Sort by confidence
Browse files Browse the repository at this point in the history
Signed-off-by: Damian Stasik <[email protected]>
  • Loading branch information
damianstasik committed Sep 2, 2024
1 parent 4e95c59 commit 16d7d6b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion frontend/src/components/LicenseSidebarBlock/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,12 @@ export function LicenseSidebarBlock(props: BlockProps) {
} else if (props.license === null || props.license.length === 0) {
content = "None detected";
} else {
const sortedLicenses = [...props.license].sort(
(a, b) => b.confidence - a.confidence,
);

const groupedLicenses = Object.groupBy(
props.license,
sortedLicenses,
(license) => license.link,
);

Expand Down

0 comments on commit 16d7d6b

Please sign in to comment.