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

Function index

__tests__/component-same-folder.test.ts:31–41  ·  view source on GitHub ↗
(files: Record<string, string>)

Source from the content-addressed store, hash-verified

29});
30
31async function index(files: Record<string, string>): Promise<CodeGraph> {
32 const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'cg-component-folder-'));
33 dirs.push(dir);
34 for (const [rel, content] of Object.entries(files)) {
35 fs.mkdirSync(path.dirname(path.join(dir, rel)), { recursive: true });
36 fs.writeFileSync(path.join(dir, rel), content);
37 }
38 const cg = await CodeGraph.init(dir, { index: true });
39 graphs.push(cg);
40 return cg;
41}
42
43/** Every edge the framework resolvers made into a node named `name`, as `file` of the target. */
44function frameworkPicks(cg: CodeGraph, name: string): string[] {

Callers 1

Calls 3

pushMethod · 0.80
joinMethod · 0.45
initMethod · 0.45

Tested by

no test coverage detected