MCPcopy Index your code
hub / github.com/nodejs/node / getPackageScopeForPath

Function getPackageScopeForPath

test/fixtures/snapshot/typescript.js:43750–43772  ·  view source on GitHub ↗
(fileName, packageJsonInfoCache, host, options)

Source from the content-addressed store, hash-verified

43748 */
43749 /*@internal*/
43750 function getPackageScopeForPath(fileName, packageJsonInfoCache, host, options) {
43751 var state = {
43752 host: host,
43753 compilerOptions: options,
43754 traceEnabled: isTraceEnabled(options, host),
43755 failedLookupLocations: [],
43756 packageJsonInfoCache: packageJsonInfoCache,
43757 features: 0,
43758 conditions: [],
43759 requestContainingDirectory: undefined,
43760 reportDiagnostic: ts.noop
43761 };
43762 var parts = ts.getPathComponents(fileName);
43763 parts.pop();
43764 while (parts.length > 0) {
43765 var pkg = getPackageJsonInfo(ts.getPathFromPathComponents(parts), /*onlyRecordFailures*/ false, state);
43766 if (pkg) {
43767 return pkg;
43768 }
43769 parts.pop();
43770 }
43771 return undefined;
43772 }
43773 ts.getPackageScopeForPath = getPackageScopeForPath;
43774 /*@internal*/
43775 function getPackageJsonInfo(packageDirectory, onlyRecordFailures, state) {

Callers 2

loadModuleFromImportsFunction · 0.85

Calls 3

isTraceEnabledFunction · 0.85
getPackageJsonInfoFunction · 0.85
popMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…