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

Function importedFilePaths

__tests__/resolution.test.ts:6067–6076  ·  view source on GitHub ↗
(fromFile: string)

Source from the content-addressed store, hash-verified

6065 }
6066
6067 function importedFilePaths(fromFile: string): string[] {
6068 const source = fileNode(fromFile);
6069 expect(source, `${fromFile} file node`).toBeDefined();
6070 return cg
6071 .getOutgoingEdges(source!.id)
6072 .filter((edge) => edge.kind === 'imports')
6073 .map((edge) => cg.getNodesByKind('file').find((n) => n.id === edge.target)?.filePath)
6074 .filter((filePath): filePath is string => Boolean(filePath))
6075 .sort();
6076 }
6077
6078 it('resolves relative Nix imports to indexed file nodes', async () => {
6079 fs.mkdirSync(path.join(tempDir, 'core'), { recursive: true });

Callers 1

resolution.test.tsFile · 0.85

Calls 4

fileNodeFunction · 0.85
mapMethod · 0.80
getNodesByKindMethod · 0.65
getOutgoingEdgesMethod · 0.45

Tested by

no test coverage detected