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

Function scanProgramSync

ark/aot/scan.ts:58–72  ·  view source on GitHub ↗
(
	key: string,
	entries: ScanEntry[],
	host: Omit<ScanHost<ScanResolution>, "load">
)

Source from the content-addressed store, hash-verified

56
57// as scanProgram, resolving each specifier as it's read, as --check does
58export const scanProgramSync = (
59 key: string,
60 entries: ScanEntry[],
61 host: Omit<ScanHost<ScanResolution>, "load">
62): ScannedProgram | string => {
63 const steps = programSteps(key, entries, host)
64 let step = steps.next()
65 while (!step.done) {
66 const [kind, requests] = step.value
67 step = steps.next(
68 kind === "load" ? [] : requests.map(request => host.resolve(...request))
69 )
70 }
71 return step.value
72}
73
74type ImportRequest = [specifier: string, importer: string, kind: ImportKind]
75

Callers 1

unprunedMessageOfFunction · 0.90

Calls 4

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

Tested by

no test coverage detected