Skip to content

Commit 41e284c

Browse files
feelepxyzljharb
andauthored
Update lib/commands/audit.js
Co-authored-by: Jordan Harband <ljharb@gmail.com>
1 parent 8ff972e commit 41e284c

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

lib/commands/audit.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,16 +297,15 @@ class VerifySignatures {
297297
}
298298

299299
humanOutput (list) {
300-
const uniquePackages = Array.from(list.reduce((set, v) => {
300+
const uniquePackages = new Set(Array.from(list, (v) => {
301301
let nameVersion = `${v.name}@${v.version}`
302302
if (this.npm.color) {
303303
nameVersion = chalk.red(nameVersion)
304304
}
305305
const registry = v.registry
306306
const suffix = registry !== defaultRegistry ? ` (${registry})` : ''
307-
set.add(`${nameVersion}${suffix}`)
308-
return set
309-
}, new Set()))
307+
return `${nameVersion}${suffix}`
308+
}))
310309

311310
return uniquePackages.join('\n')
312311
}

0 commit comments

Comments
 (0)