From dc82d65e876aaa070485b4893b6146f41bc3172b Mon Sep 17 00:00:00 2001 From: WebDevSimplified Date: Fri, 2 Dec 2022 08:05:54 -0600 Subject: [PATCH] Fix Minor Typos --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index cd623cafa..9b9f6e117 100644 --- a/README.md +++ b/README.md @@ -1234,7 +1234,7 @@ type MyUnion = | { status: "failed"; error: Error }; ``` -Such unions can be represented with the `z.discriminatedUnion` method. This enables faster evaluation, because Zod can check the _discriminator key_ (`status` in the example above) ot determine which schema should be used to parse the input. This makes parsing more efficient and lets Zod provide report friendlier errors. +Such unions can be represented with the `z.discriminatedUnion` method. This enables faster evaluation, because Zod can check the _discriminator key_ (`status` in the example above) to determine which schema should be used to parse the input. This makes parsing more efficient and lets Zod report friendlier errors. With the basic union method the input is tested against each of the provided "options", and in the case of invalidity, issues for all the "options" are shown in the zod error. On the other hand, the discriminated union allows for selecting just one of the "options", testing against it, and showing only the issues related to this "option".