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

Function leadsTo

src/resolution/import-resolver.ts:3795–3800  ·  view source on GitHub ↗
(source: string, through: (file: string) => boolean)

Source from the content-addressed store, hash-verified

3793 const mappings = context.getImportMappings(ref.filePath, ref.language);
3794 const relative = (source: string): boolean => source.startsWith('.') || source.startsWith('/');
3795 const leadsTo = (source: string, through: (file: string) => boolean): boolean => {
3796 if (source === specifier) return answers;
3797 if (!relative(source)) return false;
3798 const file = resolveImportPath(source, ref.filePath, ref.language, context);
3799 return file !== null && (file === declaringFile || through(file));
3800 };
3801 const head = ref.referenceName.split('.')[0]!;
3802 const binding = mappings.find((m) => m.localName === head);
3803 if (binding) {

Callers 1

reachesAmbientModuleFunction · 0.85

Calls 2

relativeFunction · 0.85
resolveImportPathFunction · 0.85

Tested by

no test coverage detected