(entries: ExploreEntry[])
| 271 | } |
| 272 | |
| 273 | function coalesceReadEntries(entries: ExploreEntry[]) { |
| 274 | const result: ExploreEntry[] = []; |
| 275 | const seenReads = new Set<string>(); |
| 276 | |
| 277 | for (const entry of entries) { |
| 278 | if (entry.kind !== "read") { |
| 279 | result.push(entry); |
| 280 | continue; |
| 281 | } |
| 282 | const key = entry.detail ? `${entry.label}|${entry.detail}` : entry.label; |
| 283 | if (seenReads.has(key)) { |
| 284 | continue; |
| 285 | } |
| 286 | seenReads.add(key); |
| 287 | result.push(entry); |
| 288 | } |
| 289 | return result; |
| 290 | } |
| 291 | |
| 292 | function mergeExploreEntries(base: ExploreEntry[], next: ExploreEntry[]) { |
| 293 | const merged = [...base, ...next]; |
no outgoing calls
no test coverage detected