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

Method initFlat

ark/schema/structure/sequence.ts:239–249  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

237 )
238
239 protected override initFlat(): void {
240 this.c.flatRefs = uniqueFlatRefs([
241 ...this.leading.flatMap((element, i) => flatRefsAt(`${i}`, element.node)),
242 ...this.trail.flatMap(element =>
243 // a postfix index can't be directly represented as a type
244 // key, so we just use the same matcher for variadic
245 flatRefsAt($ark.kw.nonNegativeIntegerString.internal, element)
246 )
247 ])
248 this.c.flatMorphs = []
249 }
250
251 isVariadicOnly: boolean = this.leading.length + this.postLen === 0
252 minVariadicLength: number = this.inner.minVariadicLength ?? 0

Callers

nothing calls this directly

Calls 2

uniqueFlatRefsFunction · 0.90
flatRefsAtFunction · 0.90

Tested by

no test coverage detected