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

Function isRepositoryModule

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

* Whether `specifier`, resolving to `file` from `ref`'s file, names a module of * a package this repository holds: a workspace member or a path dependency. * That module is implemented here, and a `declare module` of its name only * describes it to the type checker: react's ESLint plugin stubs *

(specifier: string, file: string | null, ref: UnresolvedRef, context: ResolutionContext)

Source from the content-addressed store, hash-verified

3721 * `vscode` for its test runner.
3722 */
3723function isRepositoryModule(specifier: string, file: string | null, ref: UnresolvedRef, context: ResolutionContext): boolean {
3724 if (file === null || isDeclarationFile(file)) return false;
3725 const workspaces = context.getWorkspacePackages?.();
3726 return !!workspaces && workspaceImportTargets(specifier, workspaces, ref.filePath) !== null;
3727}
3728
3729/**
3730 * What an import of `want` from `source` names, `file` being where `source`

Callers 2

findImportedExportFunction · 0.85
declaredModuleFileFunction · 0.85

Calls 3

isDeclarationFileFunction · 0.90
workspaceImportTargetsFunction · 0.90
getWorkspacePackagesMethod · 0.80

Tested by

no test coverage detected