(result: SearchResult)
| 593 | |
| 594 | // Get the count of files that import a given result (compact mode graph context) |
| 595 | function getImportedByCount(result: SearchResult): number { |
| 596 | const rPathNorm = normalizeGraphPath(result.filePath); |
| 597 | const importers = new Set<string>(); |
| 598 | for (const [dep, imps] of reverseImports) { |
| 599 | if (dep === rPathNorm || dep.endsWith(rPathNorm) || rPathNorm.endsWith(dep)) { |
| 600 | for (const imp of imps) importers.add(imp); |
| 601 | } |
| 602 | } |
| 603 | return importers.size; |
| 604 | } |
| 605 | |
| 606 | // Get up to maxCount named exports for a file from relationships.graph.exports |
| 607 | function getTopExports(filePath: string, maxCount = 3): string[] { |
no test coverage detected