MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / index

Function index

__tests__/php-dir-includes.test.ts:26–34  ·  view source on GitHub ↗
(files: Record<string, string>)

Source from the content-addressed store, hash-verified

24});
25
26async function index(files: Record<string, string>): Promise<CodeGraph> {
27 root = fs.mkdtempSync(path.join(os.tmpdir(), 'cg-php-dir-include-'));
28 for (const [rel, content] of Object.entries(files)) {
29 fs.mkdirSync(path.dirname(path.join(root, rel)), { recursive: true });
30 fs.writeFileSync(path.join(root, rel), content);
31 }
32 cg = await CodeGraph.init(root, { index: true });
33 return cg;
34}
35
36/** The files anything in `file` imports (the file, or its namespace), sorted. */
37function importsOf(graph: CodeGraph, file: string): string[] {

Callers 1

Calls 2

joinMethod · 0.45
initMethod · 0.45

Tested by

no test coverage detected