MCPcopy Create free account
hub / github.com/npm/cli / printPruneSummary

Method printPruneSummary

lib/utils/allow-scripts-cmd.js:383–400  ·  view source on GitHub ↗
({ removed, dryRun })

Source from the content-addressed store, hash-verified

381 }
382
383 printPruneSummary ({ removed, dryRun }) {
384 if (this.npm.flatOptions.json) {
385 output.buffer({ allowScripts: { removed, dryRun } })
386 return
387 }
388 if (removed.length === 0) {
389 output.standard('No unused allowScripts entries.')
390 return
391 }
392 const entry = removed.length === 1 ? 'entry' : 'entries'
393 output.standard(
394 `${dryRun ? 'Would remove' : 'Removed'} ${removed.length} unused allowScripts ${entry}:`
395 )
396 for (const { key, reason } of removed) {
397 const text = reason === 'not-installed' ? 'package not installed' : 'no install scripts'
398 output.standard(` ${key} (${text})`)
399 }
400 }
401}
402
403module.exports = AllowScriptsCmd

Callers 1

runPruneMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected