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

Function bundledResolutionOf

ark/aot/unplugin.ts:2752–2771  ·  view source on GitHub ↗
(
	context: RollupContext,
	specifier: string,
	importer: string | undefined,
	isTransformed: (id: string) => boolean
)

Source from the content-addressed store, hash-verified

2750// null where no bundle holds it: it's external, or a plugin refuses it, as
2751// React Router refuses a .server module in the client build
2752const bundledResolutionOf = async (
2753 context: RollupContext,
2754 specifier: string,
2755 importer: string | undefined,
2756 isTransformed: (id: string) => boolean
2757): Promise<RollupResolution | null | undefined> => {
2758 let resolved: RollupResolution | null
2759 try {
2760 resolved = await resolveUnloaded(
2761 context,
2762 specifier,
2763 importer,
2764 isTransformed
2765 )
2766 } catch {
2767 return null
2768 }
2769 if (!resolved) return
2770 return resolved.external ? null : resolved
2771}
2772
2773const asRequired = { custom: { "node-resolve": { isRequire: true } } }
2774

Callers 2

rollupScanOfFunction · 0.85
rollupUnseenOfFunction · 0.85

Calls 1

resolveUnloadedFunction · 0.85

Tested by

no test coverage detected