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

Function pipeCalled

ark/schema/node.ts:186–199  ·  view source on GitHub ↗
(
	pipedFromCtx: Traversal,
	node: BaseNode,
	data: unknown
)

Source from the content-addressed store, hash-verified

184// since a labeled narrow of this Type's that throws leaves its label set,
185// which a caller catching it, as pipe.try() does, would then raise under
186const pipeCalled = (
187 pipedFromCtx: Traversal,
188 node: BaseNode,
189 data: unknown
190): unknown => {
191 const ctx = siteTraversalOf(pipedFromCtx)
192 const lbl = ctx.lbl
193 if (lbl !== undefined) ctx.lbl = undefined
194 try {
195 return pipe(ctx, node, data)
196 } finally {
197 if (ctx.lbl !== lbl) ctx.lbl = lbl
198 }
199}
200
201// what a node is called as, so a Type deferred until it's read is the same function
202const callableOf = (cache: NodeCache) =>

Callers 1

callableOfFunction · 0.85

Calls 2

siteTraversalOfFunction · 0.90
pipeFunction · 0.90

Tested by

no test coverage detected