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

Function declaredModuleFile

src/resolution/import-resolver.ts:3755–3760  ·  view source on GitHub ↗

* The file that declares `specifier` as a module, for `ref`'s file (see * ./ambient-modules): the module, whatever file the specifier resolves to, * short of a module of the repository's own packages.

(specifier: string, ref: UnresolvedRef, context: ResolutionContext)

Source from the content-addressed store, hash-verified

3753 * short of a module of the repository's own packages.
3754 */
3755function declaredModuleFile(specifier: string, ref: UnresolvedRef, context: ResolutionContext): Node | undefined {
3756 if (!isBareModuleSpecifier(specifier, ref.language)) return undefined;
3757 const declaring = findAmbientModuleFile(specifier, ref.filePath, context);
3758 if (!declaring) return undefined;
3759 return isRepositoryModule(specifier, resolveImportPath(specifier, ref.filePath, ref.language, context), ref, context) ? undefined : declaring;
3760}
3761
3762/**
3763 * Reference kinds the extractor records by a qualified name's last part: a

Callers 2

jsModuleFileFunction · 0.85

Calls 4

findAmbientModuleFileFunction · 0.90
isBareModuleSpecifierFunction · 0.85
isRepositoryModuleFunction · 0.85
resolveImportPathFunction · 0.85

Tested by

no test coverage detected