mirror of
https://github.com/morluto/rea.git
synced 2026-12-06 15:33:56 +08:00
refactor(sbom): use one ordered dependency set (#17424)
This commit is contained in:
@@ -178,14 +178,9 @@ const bomRefsFor = (purls: readonly string[]): string[] => {
|
||||
|
||||
/** First-seen bom-refs, including a recorded self-edge. */
|
||||
const uniqueRefs = (refs: readonly (string | undefined)[]): string[] => {
|
||||
const seen = new Set<string>();
|
||||
const selected: string[] = [];
|
||||
for (const ref of refs) {
|
||||
if (ref === undefined || seen.has(ref)) continue;
|
||||
seen.add(ref);
|
||||
selected.push(ref);
|
||||
}
|
||||
return selected;
|
||||
const selected = new Set<string>();
|
||||
for (const ref of refs) if (ref !== undefined) selected.add(ref);
|
||||
return [...selected];
|
||||
};
|
||||
|
||||
/** An empty, `.` or `..` segment: empty, rooted, relative or trailing-slash paths. */
|
||||
|
||||
Reference in New Issue
Block a user