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

Function programDirOf

ark/aot/nextProgram.ts:103–109  ·  view source on GitHub ↗
(root: string, opts: PrecompilePluginOptions)

Source from the content-addressed store, hash-verified

101// one for each project and option set, kept from build to build so an answer
102// Turbopack's cache holds a module's output against stays the file it read
103const programDirOf = (root: string, opts: PrecompilePluginOptions): string => {
104 const normalized =
105 opts.cwd !== undefined && realPathOf(opts.cwd) === realPathOf(root) ?
106 (({ cwd: _, ...rest }) => rest)(opts)
107 : opts
108 return join(programsDirOf(root), hashOf(JSON.stringify(normalized)))
109}
110
111export const doneFileOf = (dir: string): string => join(dir, "done.json")
112

Callers 2

programOfFunction · 0.85
readProgramFunction · 0.85

Calls 4

realPathOfFunction · 0.90
joinFunction · 0.85
programsDirOfFunction · 0.85
hashOfFunction · 0.70

Tested by

no test coverage detected