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

Function builtOf

ark/aot/unplugin.ts:2300–2332  ·  view source on GitHub ↗
(module: BuiltBundlerModule)

Source from the content-addressed store, hash-verified

2298 const graph = compilation.moduleGraph
2299 const unbuilt: [BuiltBundlerModule, BuiltModule][] = []
2300 const builtOf = (module: BuiltBundlerModule): BuiltModule => {
2301 const known = built.get(module)
2302 if (known) return known
2303 const id = builtIdOf(module)
2304 // one of the modules Next.js builds a listed package's entry as holds
2305 // some of the file's re-exports and nothing else, so it's read as its
2306 // file, which names each, and each import it was built with resolves
2307 // what the file names so
2308 const isBarrel = isBarrelModule(module)
2309 const transformed =
2310 !!id && isTransformed(id) && (isBarrel || loadsThroughPlugin(module))
2311 const of: BuiltModule = {
2312 id,
2313 source:
2314 !id ? undefined
2315 : transformed ?
2316 read.loaded.has(id) ?
2317 read.loaded.get(id)
2318 : readFile(id)
2319 : dependencyOf(id) ? undefined
2320 : module.originalSource?.()?.source().toString(),
2321 transformed,
2322 mappings: id && read.mappings.get(id),
2323 imports: [],
2324 built:
2325 transformed && !isBarrel ?
2326 module.originalSource?.()?.source().toString()
2327 : undefined
2328 }
2329 built.set(module, of)
2330 unbuilt.push([module, of])
2331 return of
2332 }
2333 const entries = [...compilation.entries.values(), compilation.globalEntry]
2334 .flatMap(entry =>
2335 entry ? [...entry.dependencies, ...entry.includeDependencies] : []

Callers 2

builtEntriesOfFunction · 0.85
importsInFunction · 0.85

Calls 11

readFileFunction · 0.90
dependencyOfFunction · 0.90
builtIdOfFunction · 0.85
isBarrelModuleFunction · 0.85
loadsThroughPluginFunction · 0.85
isTransformedFunction · 0.70
getMethod · 0.65
toStringMethod · 0.65
hasMethod · 0.45
setMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected