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

Function checkedModuleOf

ark/aot/driver.ts:610–633  ·  view source on GitHub ↗
(
	precompiler: Precompiler,
	source: string,
	id: string,
	tracked?: TrackedPrecompiler
)

Source from the content-addressed store, hash-verified

608}
609
610const checkedModuleOf = (
611 precompiler: Precompiler,
612 source: string,
613 id: string,
614 tracked?: TrackedPrecompiler
615): CheckedModule => {
616 const result =
617 precompiler.isTransformed(id) ?
618 precompiledOf(precompiler, source, id, tracked)
619 : undefined
620 return {
621 sites:
622 result?.sites.map(({ start, end, line, column, status, strategy }) => ({
623 start,
624 end,
625 line,
626 column,
627 status,
628 ...(strategy !== undefined && { strategy })
629 })) ?? [],
630 diagnostics: result?.diagnostics ?? [],
631 schemaKeys: result ? precompiler.choosingKeysOf(id, result.sites) : []
632 }
633}
634
635export interface KeyedModule extends InlineModule {
636 files: string[]

Callers 1

answerFunction · 0.85

Calls 4

precompiledOfFunction · 0.85
isTransformedMethod · 0.80
choosingKeysOfMethod · 0.80
mapMethod · 0.65

Tested by

no test coverage detected