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