From e92873b6231ec7a76b276f081c61d9a02d00546a Mon Sep 17 00:00:00 2001 From: Tsuyoshi Yamaguchi Date: Sun, 6 Nov 2022 07:40:23 +0900 Subject: [PATCH] Fix typo in ERROR_HANDLING.md --- ERROR_HANDLING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ERROR_HANDLING.md b/ERROR_HANDLING.md index ef7114078..22d61a61a 100644 --- a/ERROR_HANDLING.md +++ b/ERROR_HANDLING.md @@ -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) { @@ -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; +type FormattedErrors = z.inferFormattedError; /* { name?: {_errors?: string[]},