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

Function edgesFrom

__tests__/catch-all-path-alias.test.ts:41–51  ·  view source on GitHub ↗

* ` : ` for every edge leaving * `file`'s nodes. JSX tags are left out: a separate pass links ` ` by * name without reading the file's imports, alias or not.

(cg: CodeGraph, file: string)

Source from the content-addressed store, hash-verified

39 * name without reading the file's imports, alias or not.
40 */
41function edgesFrom(cg: CodeGraph, file: string): string[] {
42 const ids = cg.getNodesInFile(file).map((n) => n.id);
43 return cg
44 .getOutgoingEdgesFrom(ids)
45 .filter((e) => e.metadata?.synthesizedBy !== 'jsx-render')
46 .map((e) => {
47 const target = cg.getNode(e.target);
48 return `${e.kind} ${target?.filePath}:${target?.qualifiedName}`;
49 })
50 .sort();
51}
52
53describe('a catch-all tsconfig path alias', () => {
54 it('leaves a declared package outside the repository when it names no project file', async () => {

Callers 1

Calls 4

mapMethod · 0.80
getNodeMethod · 0.80
getNodesInFileMethod · 0.65
getOutgoingEdgesFromMethod · 0.45

Tested by

no test coverage detected