MCPcopy Index your code
hub / github.com/nodejs/node / printSummary

Method printSummary

deps/npm/lib/utils/allow-scripts-cmd.js:280–300  ·  view source on GitHub ↗
(summary)

Source from the content-addressed store, hash-verified

278 }
279
280 printSummary (summary) {
281 if (this.npm.flatOptions.json) {
282 output.buffer({ allowScripts: summary })
283 return
284 }
285 const verb = this.verb === 'approve' ? 'Approved' : 'Denied'
286 let touched = 0
287 for (const { name, changes } of summary) {
288 if (changes.length === 0) {
289 continue
290 }
291 touched++
292 output.standard(`${verb} ${name}:`)
293 for (const { key, change } of changes) {
294 output.standard(` ${change} ${key}`)
295 }
296 }
297 if (touched === 0) {
298 output.standard(`Nothing to ${this.verb}; allowScripts unchanged.`)
299 }
300 }
301}
302
303module.exports = AllowScriptsCmd

Callers 1

writePolicyChangesMethod · 0.95

Calls 1

bufferMethod · 0.45

Tested by

no test coverage detected