(npm, { added, removed, changed, audited })
| 174 | } |
| 175 | |
| 176 | const packagesChangedMessage = (npm, { added, removed, changed, audited }) => { |
| 177 | const msg = ['\n'] |
| 178 | if (added === 0 && removed === 0 && changed === 0) { |
| 179 | msg.push('up to date') |
| 180 | if (audited) { |
| 181 | msg.push(', ') |
| 182 | } |
| 183 | } else { |
| 184 | if (added) { |
| 185 | msg.push(`added ${added} package${added === 1 ? '' : 's'}`) |
| 186 | } |
| 187 | |
| 188 | if (removed) { |
| 189 | if (added) { |
| 190 | msg.push(', ') |
| 191 | } |
| 192 | |
| 193 | if (added && !audited && !changed) { |
| 194 | msg.push('and ') |
| 195 | } |
| 196 | |
| 197 | msg.push(`removed ${removed} package${removed === 1 ? '' : 's'}`) |
| 198 | } |
| 199 | if (changed) { |
| 200 | if (added || removed) { |
| 201 | msg.push(', ') |
| 202 | } |
| 203 | |
| 204 | if (!audited && (added || removed)) { |
| 205 | msg.push('and ') |
| 206 | } |
| 207 | |
| 208 | msg.push(`changed ${changed} package${changed === 1 ? '' : 's'}`) |
| 209 | } |
| 210 | if (audited) { |
| 211 | msg.push(', and ') |
| 212 | } |
| 213 | } |
| 214 | if (audited) { |
| 215 | msg.push(`audited ${audited} package${audited === 1 ? '' : 's'}`) |
| 216 | } |
| 217 | |
| 218 | msg.push(` in ${ms(Date.now() - npm.started)}`) |
| 219 | output.standard(msg.join('')) |
| 220 | } |
| 221 | |
| 222 | const packagesFundingMessage = (npm, { funding }) => { |
| 223 | if (!funding) { |
no test coverage detected
searching dependent graphs…