MCPcopy Index your code
hub / github.com/adobe/react-spectrum / findPackageDir

Function findPackageDir

scripts/reportExports.js:113–131  ·  view source on GitHub ↗
(startDir)

Source from the content-addressed store, hash-verified

111}
112
113function findPackageDir(startDir) {
114 let currentDir = startDir;
115
116 while (currentDir.startsWith(packagesDir)) {
117 let packageJsonPath = path.join(currentDir, 'package.json');
118 if (fs.existsSync(packageJsonPath)) {
119 return currentDir;
120 }
121
122 let parentDir = path.dirname(currentDir);
123 if (parentDir === currentDir) {
124 break;
125 }
126
127 currentDir = parentDir;
128 }
129
130 throw new Error(`Unable to find package.json for ${startDir}`);
131}
132
133function buildPackageData(report) {
134 let packageData = new Map();

Callers 1

getImportSpecifierFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected