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

Function rewrittenIn

ark/aot/unplugin.ts:877–901  ·  view source on GitHub ↗
(
		{ key, modules }: ScannedProgram,
		compilation: BundlerCompilation,
		resolve: BundlerResolve
	)

Source from the content-addressed store, hash-verified

875 )
876 }
877 const rewrittenIn = async (
878 { key, modules }: ScannedProgram,
879 compilation: BundlerCompilation,
880 resolve: BundlerResolve
881 ) =>
882 (
883 await Promise.all(
884 Object.keys(modules).map(async id => {
885 compilation.fileDependencies.add(id)
886 const { source, transformed, mappings } = modules[id]
887 if (!transformed) return []
888 const written = await transform(source, id, mappings, key, resolve)
889 if (!written) return []
890 for (const dependency of written.dependencies)
891 compilation.fileDependencies.add(dependency)
892 return (
893 written.code !== undefined ||
894 written.errors.length ||
895 written.warnings.length
896 ) ?
897 id
898 : []
899 })
900 )
901 ).flat()
902 const isTransformedId = (id: string) =>
903 transformedFilter.include.test(id) && !transformedFilter.exclude.test(id)
904 // keeps the modules a transformed one writes, for its importers to load

Callers 1

answerBuiltFunction · 0.85

Calls 3

transformFunction · 0.70
mapMethod · 0.65
addMethod · 0.45

Tested by

no test coverage detected