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

Method constructor

ark/schema/roots/alias.ts:108–120  ·  view source on GitHub ↗
(...args: ConstructorParameters<typeof BaseRoot>)

Source from the content-addressed store, hash-verified

106 }
107
108 constructor(...args: ConstructorParameters<typeof BaseRoot>) {
109 super(...args)
110 // written now, so a later resolution stays a reference
111 this.c.fullJson = writeInnerJson(this)
112 this.expression = expressionOf(this)
113 const referenced = nodesById.get(this.reference)
114 if (hasArkKind(referenced, "context")) {
115 referenced.isReferencedById = true
116 ;(referenced.aliases ??= []).push(this)
117 if (!referenced.alias && !this.operator)
118 referenced.isReferencedAsThis = true
119 } else if (hasArkKind(referenced, "root")) this.target = referenced
120 }
121 readonly structure = undefined
122 // Allows bounds only aliases referencing their definition while it's parsed
123 closes = true

Callers

nothing calls this directly

Calls 5

writeInnerJsonFunction · 0.90
hasArkKindFunction · 0.90
expressionOfFunction · 0.70
getMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected