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

Function copiedProblemOf

ark/aot/unplugin.ts:951–965  ·  view source on GitHub ↗
(
		context: unknown,
		id: string,
		importer: string
	)

Source from the content-addressed store, hash-verified

949 let esbuildScan: BundleScan | undefined
950 // a module the scan didn't write would read a copy of a unit declared in one function
951 const copiedProblemOf = (
952 context: unknown,
953 id: string,
954 importer: string
955 ): string | undefined => {
956 const scan =
957 meta.framework === "esbuild" ?
958 esbuildScan
959 : scansByBuild.get(buildOf(context))
960 if (!scan?.replaced.has(id) || importer.startsWith(`${virtual}~arktype/`))
961 return
962 const file = fileOf(importer)
963 if (scan.loaded.get(file) === scan.scanned.modules[file]?.source) return
964 return writeUnscannedFlatMessage(printablePathOf(realCwd(), file))
965 }
966 const rollupBuild = {}
967 const buildOf = (context: unknown) =>
968 (context as { environment?: object }).environment ?? rollupBuild

Callers 1

handlerFunction · 0.85

Calls 7

fileOfFunction · 0.90
printablePathOfFunction · 0.90
buildOfFunction · 0.85
realCwdFunction · 0.85
getMethod · 0.65
hasMethod · 0.45

Tested by

no test coverage detected