MCPcopy Index your code
hub / github.com/getsentry/XcodeBuildMCP / findPackageRootFrom

Function findPackageRootFrom

src/core/resource-root.ts:18–27  ·  view source on GitHub ↗
(startDir: string)

Source from the content-addressed store, hash-verified

16}
17
18function findPackageRootFrom(startDir: string): string | null {
19 let dir = startDir;
20 while (dir !== path.dirname(dir)) {
21 if (fs.existsSync(path.join(dir, 'package.json'))) {
22 return dir;
23 }
24 dir = path.dirname(dir);
25 }
26 return null;
27}
28
29export function getPackageRoot(): string {
30 if (cachedPackageRoot) {

Callers 1

getPackageRootFunction · 0.85

Calls 1

existsSyncMethod · 0.80

Tested by

no test coverage detected