| 60 | * Builds a collapsible table section |
| 61 | */ |
| 62 | const tableSection = (title, items, columns, icon) => { |
| 63 | if (!items.length) { |
| 64 | return ''; |
| 65 | } |
| 66 | const header = `| ${columns.map(c => c.label).join(' | ')} |\n`; |
| 67 | const separator = `| ${columns.map(() => '---').join(' | ')} |\n`; |
| 68 | const rows = items |
| 69 | .map(item => `| ${columns.map(c => c.format(item)).join(' | ')} |`) |
| 70 | .join('\n'); |
| 71 | return `<details>\n<summary>${icon} ${title} <strong>(${items.length})</strong></summary>\n\n${header}${separator}${rows}\n\n</details>\n\n`; |
| 72 | }; |
| 73 | |
| 74 | /** |
| 75 | * Compares old and new assets and returns a markdown report |