MCPcopy
hub / github.com/colinhacks/zod / setError

Function setError

packages/zod/src/v3/types.ts:346–350  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

344 return this._refinement((val, ctx) => {
345 const result = check(val);
346 const setError = () =>
347 ctx.addIssue({
348 code: ZodIssueCode.custom,
349 ...getIssueProperties(val),
350 });
351 if (typeof Promise !== "undefined" && result instanceof Promise) {
352 return result.then((data) => {
353 if (!data) {

Callers 1

refineFunction · 0.85

Calls 2

getIssuePropertiesFunction · 0.85
addIssueMethod · 0.65

Tested by

no test coverage detected