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

Function alignPostfix

ark/sets/structure/sequence.ts:317–325  ·  view source on GitHub ↗
(
	variadic: SequenceElement,
	postfix: SequenceTuple,
	length: number
)

Source from the content-addressed store, hash-verified

315 elements.map(element => ({ ...element, kind: "prefix" }))
316
317const alignPostfix = (
318 variadic: SequenceElement,
319 postfix: SequenceTuple,
320 length: number
321): SequenceTuple =>
322 asPrefix([
323 ...Array.from({ length: length - postfix.length }, () => variadic),
324 ...postfix
325 ])
326
327const elementIsRequired = (el: SequenceElement) =>
328 el.kind === "prefix" || el.kind === "postfix"

Callers 1

_intersectSequencesFunction · 0.85

Calls 2

asPrefixFunction · 0.85
fromMethod · 0.65

Tested by

no test coverage detected