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

Function write

__tests__/explore-low-value-tests.test.ts:17–22  ·  view source on GitHub ↗
(root: string, files: Record<string, string>)

Source from the content-addressed store, hash-verified

15import { ToolHandler } from '../src/mcp/tools';
16
17const write = (root: string, files: Record<string, string>) => {
18 for (const [rel, content] of Object.entries(files)) {
19 fs.mkdirSync(path.dirname(path.join(root, rel)), { recursive: true });
20 fs.writeFileSync(path.join(root, rel), content);
21 }
22};
23
24const renderedFiles = (text: string): string[] => [...text.matchAll(/^\*\*`([^`]+)`\*\* —/gm)].map((m) => m[1]!);
25

Callers 1

Calls 1

joinMethod · 0.45

Tested by

no test coverage detected