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

Function includeTarget

__tests__/sync-module-config-change.test.ts:123–128  ·  view source on GitHub ↗

What the first `#include` of `file` names.

(graph: CodeGraph, file: string)

Source from the content-addressed store, hash-verified

121
122/** What the first `#include` of `file` names. */
123function includeTarget(graph: CodeGraph, file: string): string[] {
124 return graph.getNodesInFile(file).filter((n) => n.kind === 'file')
125 .flatMap((n) => graph.getOutgoingEdges(n.id))
126 .filter((e) => e.kind === 'imports')
127 .map((e) => graph.getNode(e.target)!.filePath);
128}
129
130/** A site whose server serves public/, with a file of the same name at the project root. */
131const PHP_SITE: Files = {

Calls 4

mapMethod · 0.80
getNodeMethod · 0.80
getNodesInFileMethod · 0.65
getOutgoingEdgesMethod · 0.45

Tested by

no test coverage detected