(added, removed)
| 222 | } |
| 223 | |
| 224 | function formatDiff(added, removed) { |
| 225 | if (added.length === 0 && removed.length === 0) return null |
| 226 | const lines = ['ariaDiff:'] |
| 227 | if (added.length === 0) { |
| 228 | lines.push(' added: []') |
| 229 | } else { |
| 230 | lines.push(' added:') |
| 231 | for (const [item, count] of [...countBy(added).entries()].sort(([a], [b]) => a.localeCompare(b))) { |
| 232 | const suffix = count > 1 ? ` (x${count})` : '' |
| 233 | lines.push(` - ${item}${suffix}`) |
| 234 | } |
| 235 | } |
| 236 | if (removed.length === 0) { |
| 237 | lines.push(' removed: []') |
| 238 | } else { |
| 239 | lines.push(` removed: ${removed.length} interactive elements`) |
| 240 | } |
| 241 | return lines.join('\n') |
| 242 | } |
| 243 | |
| 244 | // ───────────────────────────────────────────────────────────────── |
| 245 | // Public API — pipelines composed visibly, top-to-bottom |
no test coverage detected