Skip to content

Commit

Permalink
docs: update ref to discriminated-unions docs (#2485)
Browse files Browse the repository at this point in the history
Co-authored-by: Ryan Vermooten <ryan.vermooten@vdl.digital>
  • Loading branch information
rvermootenct and Ryan Vermooten authored Sep 29, 2023
1 parent ad2ee9c commit ae0f7a2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ERROR_HANDLING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Each ZodError has an `issues` property that is an array of `ZodIssues`. Each iss

## ZodIssue

`ZodIssue` is _not_ a class. It is a [discriminated union](https://www.typescriptlang.org/docs/handbook/advanced-types.html#discriminated-unions).
`ZodIssue` is _not_ a class. It is a [discriminated union](https://www.typescriptlang.org/docs/handbook/2/narrowing.html#discriminated-unions).

The link above is the best way to learn about the concept. Discriminated unions are an ideal way to represent a data structures that may be one of many possible variants. You can see all the possible variants defined [here](./src/ZodError.ts). They are also described in the table below if you prefer.

Expand Down

0 comments on commit ae0f7a2

Please sign in to comment.