( audit: AuditReport, options?: MdReportOptions, )
| 113 | } |
| 114 | |
| 115 | export function auditDetails( |
| 116 | audit: AuditReport, |
| 117 | options?: MdReportOptions, |
| 118 | ): MarkdownDocument { |
| 119 | const { table, issues = [], trees = [] } = audit.details ?? {}; |
| 120 | const detailsValue = auditDetailsAuditValue(audit); |
| 121 | |
| 122 | // undefined details OR empty details (undefined issues OR empty issues AND empty table) |
| 123 | if (issues.length === 0 && !table?.rows.length && trees.length === 0) { |
| 124 | return new MarkdownDocument().paragraph(detailsValue); |
| 125 | } |
| 126 | |
| 127 | const tableSectionContent = table && tableSection(table); |
| 128 | const issuesSectionContent = |
| 129 | issues.length > 0 && auditDetailsIssues(issues, options); |
| 130 | const treesSectionContent = |
| 131 | trees.length > 0 && |
| 132 | new MarkdownDocument().$concat(...trees.map(tree => treeSection(tree))); |
| 133 | |
| 134 | return new MarkdownDocument().details( |
| 135 | detailsValue, |
| 136 | new MarkdownDocument().$concat( |
| 137 | tableSectionContent, |
| 138 | treesSectionContent, |
| 139 | issuesSectionContent, |
| 140 | ), |
| 141 | ); |
| 142 | } |
| 143 | |
| 144 | export function auditsSection( |
| 145 | { plugins }: Pick<ScoredReport, 'plugins'>, |
no test coverage detected