@infra-blocks/zod-utils 0.20.0-alpha.2 → 0.20.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,9 +16,9 @@ When branding is used, the brand is a string that's the same as the name of the
|
|
|
16
16
|
is an alias for `string & z.$brand<"AwsAccountId">`.
|
|
17
17
|
|
|
18
18
|
One caveat of using branded types schema is that the default value must also be branded (as should be). So,
|
|
19
|
-
for example, where you would write `z.int().default(5)`, you instead have to write `zu.integer().default(zu.integer().parse(5))`.
|
|
20
|
-
This
|
|
21
|
-
|
|
19
|
+
for example, where you would write `z.int().default(5)`, you instead have to write `zu.number.integer().default(zu.number.integer().parse(5))`.
|
|
20
|
+
This example also highlights an inconsistency with Zod where you can have `z.int().default(123.456)`, which both
|
|
21
|
+
compiles and runs successfully.
|
|
22
22
|
|
|
23
23
|
## API
|
|
24
24
|
|