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

Method constructor

ark/type/match.ts:486–496  ·  view source on GitHub ↗
($: InternalScope, In?: BaseRoot)

Source from the content-addressed store, hash-verified

484 protected branches: BaseRoot[] = []
485
486 constructor($: InternalScope, In?: BaseRoot) {
487 super(cases =>
488 this.caseEntries(
489 Object.entries(cases).map(([k, v]) =>
490 k === "default" ? [k, v as never] : [this.$.parse(k), v as Morph]
491 )
492 )
493 )
494 this.$ = $
495 this.in = In
496 }
497
498 at(key: Key, cases?: InternalCases): InternalChainedMatchParser | Match {
499 if (this.key !== undefined) throwParseError(doubleAtMessage)

Callers

nothing calls this directly

Calls 3

caseEntriesMethod · 0.95
mapMethod · 0.65
parseMethod · 0.45

Tested by

no test coverage detected