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

Function errorBuiltBy

ark/schema/shared/errors.ts:839–848  ·  view source on GitHub ↗
(
	build: ErrorBuilder | undefined,
	context: ArkErrorContextInput,
	path: PropertyKey[],
	data: unknown,
	config: ResolvedConfig
)

Source from the content-addressed store, hash-verified

837
838// a context's error: built by its compiled builder, or spread where there's none
839const errorBuiltBy = (
840 build: ErrorBuilder | undefined,
841 context: ArkErrorContextInput,
842 path: PropertyKey[],
843 data: unknown,
844 config: ResolvedConfig
845): ArkError =>
846 build ?
847 build(context, path, data, stampError(new StampedFirst(), config))
848 : stampError({ data, path, ...context } as never, config)
849
850// the object a compiled builder assigns an error's keys to: plain, as its
851// prototype is Object's, but constructed, so each has the same shape when it's

Callers 2

_atMethod · 0.85
errorOfNodeContextFunction · 0.85

Calls 2

stampErrorFunction · 0.85
buildFunction · 0.50

Tested by

no test coverage detected