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

Method caseEntry

ark/type/match.ts:509–525  ·  view source on GitHub ↗
(
		node: BaseRoot,
		resolver: Morph
	)

Source from the content-addressed store, hash-verified

507 }
508
509 protected caseEntry(
510 node: BaseRoot,
511 resolver: Morph
512 ): InternalChainedMatchParser {
513 const wrappableNode =
514 this.key !== undefined ?
515 this.$.node("intersection", {
516 domain: this.$.node("domain", { domain: "object" }),
517 structure: this.$.node("structure", {
518 required: [this.$.node("required", { key: this.key, value: node })]
519 })
520 })
521 : node
522 const branch = wrappableNode.pipe(resolver as never)
523 this.branches.push(branch)
524 return this
525 }
526
527 match(cases: InternalCases): InternalChainedMatchParser | Match {
528 return this(cases)

Callers 2

caseMethod · 0.95
caseEntriesMethod · 0.95

Calls 2

nodeMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected