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

Function scanProgram

ark/aot/scan.ts:37–55  ·  view source on GitHub ↗
(
	key: string,
	entries: ScanEntry[],
	host: ScanHost
)

Source from the content-addressed store, hash-verified

35
36// the modules a bundle's entries reach, or why one may reach a validator unseen
37export const scanProgram = async (
38 key: string,
39 entries: ScanEntry[],
40 host: ScanHost
41): Promise<ScannedProgram | string> => {
42 const steps = programSteps(key, entries, host)
43 let step = steps.next()
44 while (!step.done) {
45 const [kind, requests] = step.value
46 step = steps.next(
47 await Promise.all(
48 kind === "load" ?
49 requests.map(id => host.load!(id))
50 : requests.map(request => host.resolve(...request))
51 )
52 )
53 }
54 return step.value
55}
56
57// as scanProgram, resolving each specifier as it's read, as --check does
58export const scanProgramSync = (

Callers 9

rollupScanOfFunction · 0.90
rollupUnseenOfFunction · 0.90
esbuildScanOfFunction · 0.90
readAndWriteFunction · 0.90
scannedFunction · 0.90
programFromFunction · 0.90
prune.test.tsFile · 0.90
scannedFromFunction · 0.90
tallyOverbakeFunction · 0.90

Calls 4

programStepsFunction · 0.85
mapMethod · 0.65
resolveMethod · 0.65
nextMethod · 0.45

Tested by 4

scannedFunction · 0.72
programFromFunction · 0.72
scannedFromFunction · 0.72
tallyOverbakeFunction · 0.72