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

Function findAotInNodeModules

ark/type/cli.ts:368–376  ·  view source on GitHub ↗
(cwd: string)

Source from the content-addressed store, hash-verified

366}
367
368const findAotInNodeModules = (cwd: string): FoundAotPackage | undefined => {
369 for (let dir = resolve(cwd); ; dir = dirname(dir)) {
370 const pkgDir = join(dir, "node_modules", "@ark", "aot")
371 const manifest = readManifest(pkgDir)
372 if (manifest?.name === "@ark/aot") return { pkgDir, manifest }
373 const parent = dirname(dir)
374 if (parent === dir) return undefined
375 }
376}
377
378const findAotViaRequire = (cwd: string): FoundAotPackage | undefined => {
379 const req = createRequire(join(resolve(cwd), "package.json"))

Callers 1

resolveAotCliFunction · 0.85

Calls 3

joinFunction · 0.85
readManifestFunction · 0.85
resolveFunction · 0.70

Tested by

no test coverage detected