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

Function include

ark/schema/units.ts:180–203  ·  view source on GitHub ↗
(node: BaseNode)

Source from the content-addressed store, hash-verified

178 // a node a morph pipes to, whose traversals pipe reads from it
179 const shapes = new Map<BaseNode, object>()
180 const include = (node: BaseNode): void => {
181 if (link.byId[node.id]) return
182 for (const reference of referencesThroughAliases([
183 node,
184 ...node.references
185 ])) {
186 if (link.byId[reference.id]) continue
187 link.byId[reference.id] = reference
188 const kinds: TraversalKind[] = []
189 const isCompiled = !!reference.unitFn || !!unbound?.get(reference)
190 if (!isCompiled) kinds.push("Allows")
191 if (reference.tfs ? !reference.c.applyInPlace : !isCompiled)
192 kinds.push("Apply")
193 if (
194 reference.tfs &&
195 includes(transformedKinds, reference.kind) &&
196 !reference.c.applyInPlace
197 )
198 kinds.push("Transform")
199 if (!kinds.length) continue
200 declared.push([reference, kinds])
201 kindsByNode.set(reference, kinds)
202 }
203 }
204 class InPlaceCompiler extends TraversalCompiler {
205 override readonly inPlace = true
206

Callers 3

reachMethod · 0.70
refMethod · 0.70
precompileInPlaceFunction · 0.70

Calls 5

referencesThroughAliasesFunction · 0.90
includesFunction · 0.90
getMethod · 0.65
pushMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected