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

Function packageFolder

src/resolution/ambient-modules.ts:746–748  ·  view source on GitHub ↗

The folder of the package `dir` is in: the nearest at or above it with a package of its own, '' for the repository's.

(dir: string, context: ResolutionContext)

Source from the content-addressed store, hash-verified

744
745/** The folder of the package `dir` is in: the nearest at or above it with a package of its own, '' for the repository's. */
746function packageFolder(dir: string, context: ResolutionContext): string {
747 return dir === '' || packageManifest(dir, context) ? dir : packageFolder(dirOf(dir), context);
748}
749
750/**
751 * Whether a `declare module` in `file` can be in the program `fromFile` is in.

Callers 1

reachesProgramFunction · 0.85

Calls 2

packageManifestFunction · 0.85
dirOfFunction · 0.70

Tested by

no test coverage detected