Skip to content

Commit

Permalink
Fix compress not accounting for multiple versions
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurCose committed Apr 20, 2023
1 parent 4dfb461 commit 2a8c853
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,15 @@ async function main() {
const reverseLookup = {};

for (const result of results.resolved) {
const existingKey = reverseLookup[result.licenseText];
let key = reverseLookup[result.licenseText];

if (!existingKey) {
reverseLookup[result.licenseText] = result.name;
output.licenseText[result.name] = result.licenseText;
if (!key) {
key = result.name + "@" + result.version;
reverseLookup[result.licenseText] = key;
output.licenseText[key] = result.licenseText;
}

output.packages.push({ ...result, licenseText: result.name });
output.packages.push({ ...result, licenseText: key });
}
} else {
output = results.resolved;
Expand Down

0 comments on commit 2a8c853

Please sign in to comment.