The files anything in `file` imports (the file, or its namespace), sorted.
(graph: CodeGraph, file: string)
| 35 | |
| 36 | /** The files anything in `file` imports (the file, or its namespace), sorted. */ |
| 37 | function importsOf(graph: CodeGraph, file: string): string[] { |
| 38 | const out = new Set<string>(); |
| 39 | for (const node of graph.getNodesInFile(file)) { |
| 40 | for (const e of graph.getOutgoingEdges(node.id)) { |
| 41 | const t = graph.getNode(e.target); |
| 42 | if (e.kind === 'imports' && t?.kind === 'file') out.add(t.filePath); |
| 43 | } |
| 44 | } |
| 45 | return [...out].sort(); |
| 46 | } |
| 47 | |
| 48 | const fn = (name: string) => `<?php\nfunction ${name}() {}\n`; |
| 49 |
no test coverage detected