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

Function edgesFrom

__tests__/react-wrapper-initializers.test.ts:142–151  ·  view source on GitHub ↗
(db: any, kind: string, where = '1=1')

Source from the content-addressed store, hash-verified

140
141 /** `kind` edges from a component to a node, as `Source>target`. */
142 const edgesFrom = (db: any, kind: string, where = '1=1'): string[] =>
143 db
144 .prepare(
145 `SELECT s.name src, t.name dst FROM edges e
146 JOIN nodes s ON s.id = e.source JOIN nodes t ON t.id = e.target
147 WHERE e.kind = ? AND s.kind = 'component' AND ${where}
148 ORDER BY s.name, t.name`
149 )
150 .all(kind)
151 .map((r: any) => `${r.src}>${r.dst}`);
152
153 it('attributes the calls and values in its template, attrs and style function to the component', async () => {
154 const db = await index();

Calls 3

mapMethod · 0.80
allMethod · 0.65
prepareMethod · 0.65

Tested by

no test coverage detected