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

Function findAmbientModuleFile

src/resolution/ambient-modules.ts:866–870  ·  view source on GitHub ↗
(specifier: string, fromFile: string, context: ResolutionContext)

Source from the content-addressed store, hash-verified

864 * default import of the package depends on. Undefined when none does.
865 */
866export function findAmbientModuleFile(specifier: string, fromFile: string, context: ResolutionContext): Node | undefined {
867 const [mod] = declarationsFor(specifier, fromFile, context);
868 if (!mod || mod.file === fromFile) return undefined;
869 return context.getNodesInFile(mod.file).find((n) => n.kind === 'file');
870}
871
872/** Whether the repository declares `specifier` itself, and its declaration exports `name` (or the default). */
873export function ambientModuleDeclares(specifier: string, name: string, isDefault: boolean, ref: UnresolvedRef, context: ResolutionContext): boolean {

Callers 2

importedTypeMemberFunction · 0.90
declaredModuleFileFunction · 0.90

Calls 2

declarationsForFunction · 0.85
getNodesInFileMethod · 0.65

Tested by

no test coverage detected