(
placed: ReadonlyArray<{ row: EntryRow; path: string; file: string | null }>
)
| 109 | * ranked executable, leads the section. |
| 110 | */ |
| 111 | export function groupRows( |
| 112 | placed: ReadonlyArray<{ row: EntryRow; path: string; file: string | null }> |
| 113 | ): EntryGroup[] { |
| 114 | const groups: EntryGroup[] = []; |
| 115 | const byPath = new Map<string, EntryGroup>(); |
| 116 | for (const { row, path, file } of placed) { |
| 117 | let group = byPath.get(path); |
| 118 | if (!group) { |
| 119 | group = { path, file, rows: [] }; |
| 120 | byPath.set(path, group); |
| 121 | groups.push(group); |
| 122 | } |
| 123 | group.rows.push(row); |
| 124 | } |
| 125 | return groups; |
| 126 | } |
| 127 | |
| 128 | /* ------------------------------------------------------------------ rows -- */ |
| 129 |
no test coverage detected