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

Function shape

__tests__/ui-program-model.test.ts:52–55  ·  view source on GitHub ↗

The graph as `from → to` lines, each with what has to hold.

(root: WireBlock)

Source from the content-addressed store, hash-verified

50
51/** The graph as `from → to` lines, each with what has to hold. */
52function shape(root: WireBlock): string[] {
53 const g = orderGraph({ root, truncated: 0 } as WireProgram, 'anchor');
54 return g.edges.map((e) => `${e.from} → ${e.to}${e.when ? ` · ${lineWords(e)}` : ''}${e.runs.length ? ` [${e.runs.join(', ')}]` : ''}`);
55}
56
57function rowsOf(root: WireBlock): Record<string, number> {
58 const g = orderGraph({ root, truncated: 0 } as WireProgram, 'anchor');

Callers 1

Calls 4

orderGraphFunction · 0.90
lineWordsFunction · 0.90
mapMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected