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

Function scanOf

ark/aot/unplugin.ts:1019–1054  ·  view source on GitHub ↗
(
		context: RollupContext,
		file: string,
		code: string,
		mappings: string | undefined
	)

Source from the content-addressed store, hash-verified

1017 })
1018 }
1019 const scanOf = (
1020 context: RollupContext,
1021 file: string,
1022 code: string,
1023 mappings: string | undefined
1024 ): Promise<BundleScan | undefined> | BundleScan | undefined => {
1025 const build = buildOf(context)
1026 const pending = pendingScans.get(build)
1027 if (!pending) return scansByBuild.get(build)
1028 arrive(pending, file, code)
1029 if (mappings) pending.mappings.set(file, mappings)
1030 pending.scanned ??= rollupScanOf(
1031 context,
1032 `${++scans}`,
1033 pending.inputs,
1034 id =>
1035 transformedFilter.include.test(id) &&
1036 !transformedFilter.exclude.test(id),
1037 id => arrivalOf(pending, id),
1038 id => pending.mappings.get(id),
1039 scanned =>
1040 scanChoosing(bundlerResolveOf(context, isTransformedId), scanned),
1041 realCwd()
1042 )
1043 .catch(
1044 (e: unknown): ProgramScan<BundleScan> => ({
1045 warnings: [unreadMessageOf(e)]
1046 })
1047 )
1048 .then(scan => {
1049 pending.warnings = scan.warnings
1050 if (scan.read) scansByBuild.set(build, scan.read)
1051 return scan.read
1052 })
1053 return pending.scanned
1054 }
1055 // a module Rollup's watch mode kept was written for an earlier bundle
1056 const shouldTransformCachedModule = ({ id }: { id: string }) =>
1057 rewritesCached ||

Callers 1

handlerFunction · 0.85

Calls 11

buildOfFunction · 0.85
arriveFunction · 0.85
rollupScanOfFunction · 0.85
arrivalOfFunction · 0.85
scanChoosingFunction · 0.85
bundlerResolveOfFunction · 0.85
realCwdFunction · 0.85
unreadMessageOfFunction · 0.85
testMethod · 0.80
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected