Skip to content

Commit

Permalink
Update lib/commands/audit.js
Browse files Browse the repository at this point in the history
Co-authored-by: Jordan Harband <ljharb@gmail.com>
  • Loading branch information
feelepxyz and ljharb committed May 23, 2022
1 parent d496c7d commit 4376d83
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/commands/audit.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,16 +297,15 @@ class VerifySignatures {
}

humanOutput (list) {
const uniquePackages = Array.from(list.reduce((set, v) => {
const uniquePackages = new Set(Array.from(list, (v) => {
let nameVersion = `${v.name}@${v.version}`
if (this.npm.color) {
nameVersion = chalk.red(nameVersion)
}
const registry = v.registry
const suffix = registry !== defaultRegistry ? ` (${registry})` : ''
set.add(`${nameVersion}${suffix}`)
return set
}, new Set()))
return `${nameVersion}${suffix}`
}))

return uniquePackages.join('\n')
}
Expand Down

0 comments on commit 4376d83

Please sign in to comment.