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

Function ring

__tests__/cli-cycles.test.ts:35–43  ·  view source on GitHub ↗

`count` files in one import ring: each imports the next, the last the first.

(count: number)

Source from the content-addressed store, hash-verified

33
34/** `count` files in one import ring: each imports the next, the last the first. */
35function ring(count: number): Record<string, string> {
36 const files: Record<string, string> = {};
37 for (let i = 0; i < count; i++) {
38 const next = (i + 1) % count;
39 files[`src/f${String(i).padStart(2, '0')}.ts`] =
40 `import { f${next} } from './f${String(next).padStart(2, '0')}';\nexport function f${i}() { return f${next}(); }\n`;
41 }
42 return files;
43}
44
45describe('codegraph cycles', () => {
46 let dir: string;

Callers 1

cli-cycles.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected