(summary)
| 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 | |
| 303 | module.exports = AllowScriptsCmd |
no test coverage detected