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

Function unreadCallErrors

ark/type/runtime.ts:1149–1162  ·  view source on GitHub ↗
(
	apply: CompactApply,
	data: unknown,
	args: ValidatorArgs,
	onFail?: ArkErrors.Handler | null,
	Ctx: IssuesClass = ArkErrors
)

Source from the content-addressed store, hash-verified

1147}
1148
1149export const unreadCallErrors = (
1150 apply: CompactApply,
1151 data: unknown,
1152 args: ValidatorArgs,
1153 onFail?: ArkErrors.Handler | null,
1154 Ctx: IssuesClass = ArkErrors
1155): unknown => {
1156 const errors = new (findsOnRead ? Ctx : unreadOf(Ctx))(data, 0, apply)
1157 if (args.length) {
1158 if (args[0]) return args[0].piped(errors as never)
1159 if (args[1] !== undefined) onFail = args[1] as never
1160 }
1161 return onFail ? onFail(errors) : errors
1162}
1163
1164export const emptyMeta: ArkEnv.meta = /* @__PURE__ */ freeze({})
1165

Callers 1

unreadElementsFunction · 0.85

Calls 3

unreadOfFunction · 0.85
onFailFunction · 0.85
pipedMethod · 0.80

Tested by

no test coverage detected