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

Function linksFrom

__tests__/go-struct-field-refs.test.ts:499–505  ·  view source on GitHub ↗
(file: string, name: string)

Source from the content-addressed store, hash-verified

497
498 /** `kind file:qualifiedName` of each non-contains edge out of `name` in `file`, sorted. */
499 const linksFrom = (file: string, name: string) => {
500 const links = cg!.getOutgoingEdgesFrom([nodeNamed(file, name).id])
501 .filter((e) => e.kind !== 'contains')
502 .map((e) => ({ kind: e.kind, target: cg!.getNode(e.target)! }))
503 .map(({ kind, target }) => `${kind} ${target.filePath}:${target.qualifiedName}`);
504 return [...new Set(links)].sort();
505 };
506
507 /** `kind name` of each reference out of `name` in `file` that resolution left unresolved, sorted. */
508 const unresolvedFrom = (file: string, name: string) =>

Callers 1

Calls 4

mapMethod · 0.80
getNodeMethod · 0.80
nodeNamedFunction · 0.70
getOutgoingEdgesFromMethod · 0.45

Tested by

no test coverage detected