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

Function programAnswerOf

ark/aot/nextProgram.ts:614–622  ·  view source on GitHub ↗
(
	{ dir }: ReadProgramDir,
	id: string
)

Source from the content-addressed store, hash-verified

612// a module the read holds, or undefined where it left it; what doesn't match is
613// the build reaching a validator the read didn't see
614export const programAnswerOf = (
615 { dir }: ReadProgramDir,
616 id: string
617): ProgramAnswer | undefined => {
618 const path = answerFileOf(dir, id)
619 return existsSync(path) ?
620 (JSON.parse(readFileSync(path, "utf8")) as ProgramAnswer)
621 : undefined
622}
623
624// arktype's own, which a linked install resolves out of node_modules, and the
625// read doesn't follow as its modules never import a program's

Callers 1

answerFromProgramFunction · 0.90

Calls 2

answerFileOfFunction · 0.85
parseMethod · 0.45

Tested by

no test coverage detected