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

Method printSummary

lib/utils/allow-scripts-cmd.js:308–328  ·  view source on GitHub ↗
(summary)

Source from the content-addressed store, hash-verified

306 }
307
308 printSummary (summary) {
309 if (this.npm.flatOptions.json) {
310 output.buffer({ allowScripts: summary })
311 return
312 }
313 const verb = this.verb === 'approve' ? 'Approved' : 'Denied'
314 let touched = 0
315 for (const { name, changes } of summary) {
316 if (changes.length === 0) {
317 continue
318 }
319 touched++
320 output.standard(`${verb} ${name}:`)
321 for (const { key, change } of changes) {
322 output.standard(` ${change} ${key}`)
323 }
324 }
325 if (touched === 0) {
326 output.standard(`Nothing to ${this.verb}; allowScripts unchanged.`)
327 }
328 }
329
330 // `npm install-scripts prune`: drop package.json#allowScripts entries that no
331 // longer match an installed package with an install script. Edits only

Callers 1

writePolicyChangesMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected