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

Function packageRootOf

ark/aot/host.ts:434–447  ·  view source on GitHub ↗
(
	name: string,
	from: string
)

Source from the content-addressed store, hash-verified

432}
433
434export const packageRootOf = (
435 name: string,
436 from: string
437): string | undefined => {
438 for (let dir = from; ; dir = dirname(dir)) {
439 const root = join(dir, "node_modules", name)
440 if (
441 basename(dir) !== "node_modules" &&
442 existsSync(join(root, "package.json"))
443 )
444 return realPathOf(root)
445 if (dir === dirname(dir)) return
446 }
447}
448
449// a host without a channel for source maps reads one from the code
450export const appendSourceMap = (

Callers 6

readsProgramFunction · 0.90
checkNextExternalsFunction · 0.90
fingerprintOfFunction · 0.90
checkDependenciesFunction · 0.90
host.tsFile · 0.85
dependsOnArktypeFunction · 0.85

Calls 2

joinFunction · 0.85
realPathOfFunction · 0.85

Tested by

no test coverage detected