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

Function isRepositoryModule

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

3548 * `vscode` for its test runner.
3549 */
3550function isRepositoryModule(specifier: string, file: string | null, ref: UnresolvedRef, context: ResolutionContext): boolean {
3551 if (file === null || isDeclarationFile(file)) return false;
3552 const workspaces = context.getWorkspacePackages?.();
3553 return !!workspaces && workspaceImportTargets(specifier, workspaces, ref.filePath) !== null;
3554}
3555
3556/**
3557 * 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