(
overview: Pick<ArchitectureOverviewDto, 'entryPoints' | 'routes'> | undefined,
limit: number = MAX_ENTRY_ROWS,
)
| 135 | * not reshuffle between two openings of the same dialog. |
| 136 | */ |
| 137 | export function entryRows( |
| 138 | overview: Pick<ArchitectureOverviewDto, 'entryPoints' | 'routes'> | undefined, |
| 139 | limit: number = MAX_ENTRY_ROWS, |
| 140 | ): { rows: EntryRow[]; total: number } { |
| 141 | const all = [ |
| 142 | ...(overview?.entryPoints ?? []).map(rowOfHit), |
| 143 | ...(overview?.routes ?? []).map(rowOfRoute), |
| 144 | ]; |
| 145 | const seen = new Set<string>(); |
| 146 | const unique = all.filter((row) => { |
| 147 | if (seen.has(row.key)) { |
| 148 | return false; |
| 149 | } |
| 150 | seen.add(row.key); |
| 151 | return true; |
| 152 | }); |
| 153 | return { rows: unique.slice(0, Math.max(0, limit)), total: unique.length }; |
| 154 | } |
no outgoing calls
no test coverage detected