Skip to content

Commit

Permalink
Fix group vs name in CycloneDX output
Browse files Browse the repository at this point in the history
  • Loading branch information
eoftedal committed Sep 26, 2024
1 parent 43b02c8 commit dfeccaf
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 1.6.5

### Bugfix

* Fix group vs name for scoped names in CycloneDX output

## 1.6.4

### Improvements
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"author": "Erlend Oftedal <[email protected]>",
"name": "retire-site-scanner",
"version": "1.6.4",
"version": "1.6.5",
"license": "Apache-2.0",
"description": "A scanner for checking a web site using retire.js",
"main": "dist/index.js",
Expand Down
5 changes: 4 additions & 1 deletion src/log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ type CycloneDXComponent = {
name: string;
version: string;
"bom-ref": string;
group?: string;
purl?: string;
licenses?: Array<{
license?: {
Expand Down Expand Up @@ -208,10 +209,12 @@ export function convertToCycloneDX(resultToConvert: typeof collectedResults) {
res.results.forEach((c) => {
const key = c.component + "@" + c.version;
const found = components.has(key);
const nameParts = c.component.split("/").reverse();
const comp: CycloneDXComponent = components.get(key) || {
type: "library",
"bom-ref": randomUUID(),
name: c.component,
name: nameParts[0],
group: nameParts[1],
version: c.version,
purl: generatePURL(c),
properties: [],
Expand Down

0 comments on commit dfeccaf

Please sign in to comment.