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

Function applyPipedResolution

ark/schema/shared/traversal.ts:721–736  ·  view source on GitHub ↗
(
	ctx: InternalTraversal,
	node: BaseNode,
	data: unknown
)

Source from the content-addressed store, hash-verified

719
720// a morph's output is new data, tracked from the cyclic node's root
721const applyPipedResolution = (
722 ctx: InternalTraversal,
723 node: BaseNode,
724 data: unknown
725): void => {
726 const { recv, recvAt, chkOnly } = ctx
727 receive(ctx, data)
728 ctx.chkOnly = true
729 const piped = traversalOf(ctx, data)
730 piped.chkOnly = true
731 const { _errors } = applyCyclic(node, data, piped)
732 if (_errors) addErrors(ctx, _errors)
733 ctx.chkOnly = chkOnly
734 ctx.recv = recv
735 ctx.recvAt = recvAt
736}
737
738export const transformsValid = (ctx: InternalTraversal): boolean =>
739 ctx.branches.length === 0 && !ctx.chkOnly

Callers 1

pipeFunction · 0.85

Calls 4

traversalOfFunction · 0.85
applyCyclicFunction · 0.85
receiveFunction · 0.70
addErrorsFunction · 0.70

Tested by

no test coverage detected