Function
sortPlugins
(
plugins: (Omit<PluginReport, 'audits' | 'groups'> & {
audits: AuditReport[];
groups?: ScoredGroup[];
})[],
)
Source from the content-addressed store, hash-verified
| 137 | |
| 138 | // NOTE: Only audits are sorted as groups are only listed within categories, not separately |
| 139 | function sortPlugins( |
| 140 | plugins: (Omit<PluginReport, 'audits' | 'groups'> & { |
| 141 | audits: AuditReport[]; |
| 142 | groups?: ScoredGroup[]; |
| 143 | })[], |
| 144 | ) { |
| 145 | return plugins.map(plugin => ({ |
| 146 | ...plugin, |
| 147 | audits: plugin.audits.toSorted(compareAudits).map(audit => |
| 148 | audit.details?.issues |
| 149 | ? { |
| 150 | ...audit, |
| 151 | details: { |
| 152 | ...audit.details, |
| 153 | issues: audit.details.issues.toSorted(compareIssues), |
| 154 | }, |
| 155 | } |
| 156 | : audit, |
| 157 | ), |
| 158 | })); |
| 159 | } |
Tested by
no test coverage detected