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

Function errorFromNodeAt

ark/schema/shared/errors.ts:660–675  ·  view source on GitHub ↗
(
	ctx: InternalTraversal,
	context: SiteContext,
	relativePath: array<PropertyKey>,
	data: unknown
)

Source from the content-addressed store, hash-verified

658
659/** adds a node's error at a path from ctx's, as a site's is added */
660export const errorFromNodeAt = (
661 ctx: InternalTraversal,
662 context: SiteContext,
663 relativePath: array<PropertyKey>,
664 data: unknown
665): ArkError =>
666 ctx.addError(
667 errorOfNodeContext(
668 context as never,
669 relativePath.length > 1 ?
670 [...ctx.path, ...relativePath]
671 : pathAt(ctx.path, relativePath[0]),
672 data,
673 ctx.config
674 )
675 )
676
677/** adds a union's error from each branch's first */
678export const errorFromUnion = (

Callers 1

errorFromMissMethod · 0.90

Calls 3

pathAtFunction · 0.90
errorOfNodeContextFunction · 0.85
addErrorMethod · 0.45

Tested by

no test coverage detected