(npm, report)
| 149 | } |
| 150 | |
| 151 | const getAuditReport = (npm, report) => { |
| 152 | if (!report) { |
| 153 | return |
| 154 | } |
| 155 | |
| 156 | // when in silent mode, we print nothing. |
| 157 | // the JSON output is going to just JSON.stringify() the report object. |
| 158 | const reporter = npm.silent ? 'quiet' |
| 159 | : npm.flatOptions.json ? 'quiet' |
| 160 | : npm.command !== 'audit' ? 'install' |
| 161 | : 'detail' |
| 162 | const defaultAuditLevel = npm.command !== 'audit' ? 'none' : 'low' |
| 163 | const auditLevel = npm.flatOptions.auditLevel || defaultAuditLevel |
| 164 | |
| 165 | const res = npmAuditReport(report, { |
| 166 | reporter, |
| 167 | ...npm.flatOptions, |
| 168 | auditLevel, |
| 169 | chalk: npm.chalk, |
| 170 | }) |
| 171 | if (npm.command === 'audit') { |
| 172 | process.exitCode = process.exitCode || res.exitCode |
| 173 | } |
| 174 | return res |
| 175 | } |
| 176 | |
| 177 | const packagesChangedMessage = (npm, { added, removed, changed, audited }) => { |
| 178 | const msg = ['\n'] |
no outgoing calls
no test coverage detected