Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typo in ERROR_HANDLING.md #1543

Merged
merged 1 commit into from Nov 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions ERROR_HANDLING.md
Expand Up @@ -375,7 +375,7 @@ function MyForm(){

Because `.format` returns a deeply nested object, the errors are contained within the `_errors` property to avoid key collisions. However this isn't necessary if your object schema is only one level deep.

In this scenarion, `.flatten()` may be more convenient.
In this scenario, `.flatten()` may be more convenient.

```ts
if (!result.success) {
Expand Down Expand Up @@ -440,7 +440,7 @@ result.error.flatten((issue: ZodIssue) => ({
You can infer the return type signature of `.format()` and `.flatten()` with the following utilities:

```ts
type FormattedErrors = z.inferFormattedErrors<typeof FormData>;
type FormattedErrors = z.inferFormattedError<typeof FormData>;
/*
{
name?: {_errors?: string[]},
Expand Down