MCPcopy Create free account
hub / github.com/arktypeio/arktype / locateProjectRoot

Function locateProjectRoot

ark/type/cli.ts:79–85  ·  view source on GitHub ↗
(startDir: string)

Source from the content-addressed store, hash-verified

77}
78
79const locateProjectRoot = (startDir: string): string | undefined => {
80 for (let dir = resolve(startDir); ; dir = dirname(dir)) {
81 if (existsSync(join(dir, "package.json"))) return dir
82 const parent = dirname(dir)
83 if (parent === dir) return undefined
84 }
85}
86
87export const detectPackageManager = (startDir: string): PackageManager => {
88 for (let dir = resolve(startDir); ; dir = dirname(dir)) {

Callers 3

runInitFunction · 0.85
runMigrateFunction · 0.85
runSkillFunction · 0.85

Calls 2

joinFunction · 0.85
resolveFunction · 0.70

Tested by

no test coverage detected