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

Function read

ark/aot/host.ts:416–429  ·  view source on GitHub ↗
(file: string)

Source from the content-addressed store, hash-verified

414 const modules = new Set<string>()
415 const seen = new Set<string>()
416 const read = (file: string) => {
417 if (seen.has(file)) return
418 seen.add(file)
419 for (const [, imported] of (host.readFile(file) ?? "").matchAll(
420 importOrComputed
421 )) {
422 if (!imported || arktypeEntries.includes(packageNameOf(imported)))
423 modules.add(file)
424 else {
425 const resolved = host.resolve(imported, file)
426 if (resolved) read(resolved)
427 }
428 }
429 }
430 read(entry)
431 return [...modules]
432}

Callers 2

aliasArgumentsInMethod · 0.70
modulesLoadingArktypeFunction · 0.70

Calls 5

packageNameOfFunction · 0.85
readFileMethod · 0.80
resolveMethod · 0.65
hasMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected