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

Function addIssueToContext

packages/zod/src/v3/helpers/parseUtil.ts:72–86  ·  view source on GitHub ↗
(ctx: ParseContext, issueData: IssueData)

Source from the content-addressed store, hash-verified

70};
71
72export function addIssueToContext(ctx: ParseContext, issueData: IssueData): void {
73 const overrideMap = getErrorMap();
74 const issue = makeIssue({
75 issueData: issueData,
76 data: ctx.data,
77 path: ctx.path,
78 errorMaps: [
79 ctx.common.contextualErrorMap, // contextual error map is first priority
80 ctx.schemaErrorMap, // then schema-bound map if available
81 overrideMap, // then global override map
82 overrideMap === defaultErrorMap ? undefined : defaultErrorMap, // then global default map
83 ].filter((x) => !!x),
84 });
85 ctx.common.issues.push(issue);
86}
87
88export type ObjectPair = {
89 key: SyncParseReturnType<any>;

Callers 15

_parseMethod · 0.85
_parseMethod · 0.85
_parseMethod · 0.85
_getInvalidInputMethod · 0.85
_parseMethod · 0.85
_parseMethod · 0.85
_parseMethod · 0.85
_parseMethod · 0.85
_parseMethod · 0.85
_parseMethod · 0.85
_parseMethod · 0.85
_parseMethod · 0.85

Calls 2

makeIssueFunction · 0.85
getErrorMapFunction · 0.50

Tested by

no test coverage detected