(findings: Finding[])
| 28 | [...findings].sort((a, b) => RANK[a.severity] - RANK[b.severity]); |
| 29 | |
| 30 | const groupBySeverity = (findings: Finding[]): Map<Severity, Finding[]> => { |
| 31 | const map = new Map<Severity, Finding[]>(); |
| 32 | for (const finding of findings) { |
| 33 | const bucket = map.get(finding.severity) ?? []; |
| 34 | bucket.push(finding); |
| 35 | map.set(finding.severity, bucket); |
| 36 | } |
| 37 | return map; |
| 38 | }; |
| 39 | |
| 40 | export const renderReport = (report: AuditReport): string => { |
| 41 | const lines: string[] = []; |
no test coverage detected