(
failures: Array<{ name: string; reason?: string; error?: string }>,
includeReasons: boolean,
)
| 14 | * @returns Formatted string like "plugin-a (reason); plugin-b (reason)" or "plugin-a, plugin-b" |
| 15 | */ |
| 16 | export function formatFailureDetails( |
| 17 | failures: Array<{ name: string; reason?: string; error?: string }>, |
| 18 | includeReasons: boolean, |
| 19 | ): string { |
| 20 | const maxShow = 2 |
| 21 | const details = failures |
| 22 | .slice(0, maxShow) |
| 23 | .map(f => { |
| 24 | const reason = f.reason || f.error || 'unknown error' |
| 25 | return includeReasons ? `${f.name} (${reason})` : f.name |
| 26 | }) |
| 27 | .join(includeReasons ? '; ' : ', ') |
| 28 | |
| 29 | const remaining = failures.length - maxShow |
| 30 | const moreText = remaining > 0 ? ` and ${remaining} more` : '' |
| 31 | |
| 32 | return `${details}${moreText}` |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * Extract source display string from marketplace configuration |
no outgoing calls
no test coverage detected