fix(deps): update dependency zod to ^3.20.0 #105
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^3.19.1
->^3.20.0
Release Notes
colinhacks/zod
v3.20.0
: -betaCompare Source
Breaking changes
There are no breaking API changes, however TypeScript versions
4.4
and earlier are no longer officially supported.New features
The most feature-packed release since Zod 3.0!
.pipe()
A new schema method
.pipe()
is now available on all schemas. which can be used to chain multiple schemas into a "validation pipeline". Typically this will be used in conjunction with.transform()
.The
.pipe()
method returns aZodPipeline
instance.z.coerce
Zod now provides a more convenient way to coerce primitive values.
During the parsing step, the input is passed through the
String()
function, which is a JavaScript built-in for coercing data into strings. Note that the returned schema is aZodString
instance so you can use all string methods.All primitive types support coercion.
.catch()
A new schema method
.catch()
is now available on all schemas. It can be used to provide a "catchall" value that will be returned in the event of a parsing error.The
.catch()
method returns aZodCatch
instance.z.symbol()
A long-missing hole in Zod's type system is finally filled! Thanks @santosmarco-caribou.
Relatedly, you can also pass symbols into
z.literal()
.z.string().datetime()
A new method has been added to
ZodString
to validate ISO datetime strings. Thanks @samchungy!This method defaults to only allowing UTC datetimes (the ones that end in
"Z"
). No timezone offsets are allowed; arbitrary sub-second precision is supported.Offsets can be supported with the
offset
parameter.You can additionally constrain the allowable
precision
. This specifies the number of digits that should follow the decimal point.z.number().finite()
Restrict a number schema to finite values. Thanks @igalklebanov.
What's Changed
mask
parameter to.required
method by @SrBrahma in https://github.com/colinhacks/zod/pull/1315fatal
toZodIssue
. by @igalklebanov in https://github.com/colinhacks/zod/pull/1555.finite()
@ZodNumber
. by @igalklebanov in https://github.com/colinhacks/zod/pull/1546.required()
doesn't remove optional flag from the result of.nullish()
. by @igalklebanov in https://github.com/colinhacks/zod/pull/1542datetime()
string formats by @samchungy in https://github.com/colinhacks/zod/pull/1494path
parameter into account within.parseAsync()
by @RobinTail in https://github.com/colinhacks/zod/pull/1513ZodSymbol
by @santosmarco-caribou in https://github.com/colinhacks/zod/pull/1448New Contributors
Full Changelog: colinhacks/zod@v3.19.1...v3.20.0
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - "after 8:00 before 23:00 every weekday except on Friday" in timezone UTC.
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.