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

Function bindPrecompiled

ark/schema/units.ts:442–455  ·  view source on GitHub ↗
(
	root: BaseNode,
	[bind, unitFn, dependencies]: PrecompiledUnit
)

Source from the content-addressed store, hash-verified

440}
441
442const bindPrecompiled = (
443 root: BaseNode,
444 [bind, unitFn, dependencies]: PrecompiledUnit
445): void => {
446 const [declared, refs, dependencyNodes] = bind(root, unitConstants)
447 const traversals: Fn[] = []
448 for (let i = 0; i < dependencies.length; i++) {
449 const [key, kind] = dependencies[i]
450 const dependency = dependencyNodes[i]
451 if (!dependency.unitFn) bindPrecompiled(dependency, precompiledUnits[key])
452 traversals.push(dependency[`t${traversalKinds[kind]}`]!)
453 }
454 bindUnit(declared, unitFn, unitFn(traversals, refs), root.byId)
455}
456
457// a tuple's defaults nest each thunk in an array of pairs
458const forEachElement = (

Callers 1

bindRegisteredUnitsFunction · 0.85

Calls 3

bindFunction · 0.85
bindUnitFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected