The files anything in `file` imports (the file, or its namespace), sorted.
(graph: CodeGraph, file: string)
| 46 | |
| 47 | /** The files anything in `file` imports (the file, or its namespace), sorted. */ |
| 48 | function importsOf(graph: CodeGraph, file: string): string[] { |
| 49 | const out = new Set<string>(); |
| 50 | for (const node of graph.getNodesInFile(file)) { |
| 51 | for (const e of graph.getOutgoingEdges(node.id)) { |
| 52 | const t = graph.getNode(e.target); |
| 53 | if (e.kind === 'imports' && t?.kind === 'file') out.add(t.filePath); |
| 54 | } |
| 55 | } |
| 56 | return [...out].sort(); |
| 57 | } |
| 58 | |
| 59 | const fn = (name: string) => `<?php\nfunction ${name}() {}\n`; |
| 60 | const config = (webRoot: unknown) => JSON.stringify({ webRoot }); |
no test coverage detected