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

Function indexProject

__tests__/go-nested-module.test.ts:61–70  ·  view source on GitHub ↗
(files: Record<string, string>)

Source from the content-addressed store, hash-verified

59const projects: Array<{ root: string; cg: CodeGraph }> = [];
60
61async function indexProject(files: Record<string, string>): Promise<CodeGraph> {
62 const root = fs.mkdtempSync(path.join(os.tmpdir(), 'cg-go-nested-mod-'));
63 for (const [rel, content] of Object.entries(files)) {
64 fs.mkdirSync(path.dirname(path.join(root, rel)), { recursive: true });
65 fs.writeFileSync(path.join(root, rel), content);
66 }
67 const cg = await CodeGraph.init(root, { index: true });
68 projects.push({ root, cg });
69 return cg;
70}
71
72afterAll(() => {
73 for (const { root, cg } of projects) {

Callers 1

Calls 3

pushMethod · 0.80
joinMethod · 0.45
initMethod · 0.45

Tested by

no test coverage detected