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

Function isRepositoryModule

src/resolution/import-resolver.ts:3725–3729  ·  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

3723 * `vscode` for its test runner.
3724 */
3725function isRepositoryModule(specifier: string, file: string | null, ref: UnresolvedRef, context: ResolutionContext): boolean {
3726 if (file === null || isDeclarationFile(file)) return false;
3727 const workspaces = context.getWorkspacePackages?.();
3728 return !!workspaces && workspaceImportTargets(specifier, workspaces, ref.filePath) !== null;
3729}
3730
3731/**
3732 * 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