fix(deps): update dependency zod to v3.22.3 [security] #7
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.17.9->3.22.3GitHub Vulnerability Alerts
CVE-2023-4316
Zod version 3.22.2 allows an attacker to perform a denial of service while validating emails.
Release Notes
colinhacks/zod (zod)
v3.22.3Compare Source
Commits:
1e23990Commit9bd3879docs: remove obsolete text about readonly types (#2676)f59be09clarify datetime ISO 8601 (#2673)64dcc8eUpdate sponsors18115a8Formatting28c1927Update sponsorsad2ee9c2718 Updated Custom Schemas documentation example to use type narrowing (#2778)ae0f7a2docs: update ref to discriminated-unions docs (#2485)2ba00fe[2609] fix ReDoS vulnerability in email regex (#2824)1e61d763.22.3v3.22.2Compare Source
Commits:
13d9e6bFix lint0d49f10docs: add typeschema to ecosystem (#2626)8e4af7bX to Zod: add app.quicktype.io (#2668)792b3efFix superrefine typesv3.22.1Compare Source
Commits:
Fix handing of
thisin ZodFunction schemas. The parse logic for function schemas now requires theReflectAPI.932cc47Initial prototype fix for issue #2651 (#2652)0a055e73.22.1v3.22.0Compare Source
ZodReadonlyThis release introduces
ZodReadonlyand the.readonly()method onZodType.Calling
.readonly()on any schema returns aZodReadonlyinstance that wraps the original schema. The new schema parses all inputs using the original schema, then callsObject.freeze()on the result. The inferred type is also marked asreadonly.The inferred type uses TypeScript's built-in readonly types when relevant.
Commits:
6dad907Comments56ace68Fix deno test3809d54Add superformsd1ad522Add transloadita3bb701Testing on Typescript 5.0 (#2221)51e14bedocs: update deprecated link (#2219)a263814fixed Datetime & IP TOC links502384edocs: add mobx-zod-form to form integrations (#2299)a8be450docs: Addzockerto Ecosystem section (#2416)15de22aAllow subdomains and hyphens inZodString.email(#2274)00f5783Addzod-openapito ecosystem (#2434)0a17340docs: fix minor typo (#2439)60a2134Add masterborn0a90ed1chore: moveexports.typesfield to first spot @ package.json. (#2443)67f35b1docs: allow Zod to be used in dev tools at site (#2432)6795c57Fix not working Deno doc link. (#2428)37e9c55Generalize uuidRegex0969950adds ctx to preprocess (#2426)af08390fix: super refinement function types (#2420)36fef58Make email regex reasonable (#2157)f627d14Document canarye06321cdocs: add tapiduck to API libraries (#2410)11e507cdocs: add ts as const example in zod enums (#2412)5427565docs: add zod-fixture to mocking ecosystem (#2409)d3bf7e6docs: addzodockto mocking ecosystem (#2394)2270ae5remove "as any" casts in createZodEnum (#2332)00bdd0afix proto pollution vulnerability (#2239)a3c5256Fix error_handling unrecognized_keys example4f75cbcAdds getters to Map for key + value (#2356)ca7b032FMC (#2346)6fec8bddocs: fix typo in link fragment (#2329)16f90bdUpdate README.md2c80250Update readmeeaf64e0Update sponsorsc576311Update readme5e23b4fAdd*.mdpattern to prettier (#2476)898dcedRevamp tests6309322Update test runnersc0aece1Add vitest config73a5610Update script8d8e1a2Fix deno test bug9eb2508Clean up configscfbc7b3Fix root jest config8677f68docs(comparison-yup): Yup added partial() and deepPartial() in v1 (#2603)fb00edddocs: add VeeValidate form library for Vue.js (#2578)ab8e717docs: fix typo in z.object (#2570)d870407docs: fix incomplete Records example (#2579)5adae24docs: add conform form integration (#2577)8b8ab3eUpdate README.md (#2562)6aab901fix typo test name (#2542)81a89f5Update nullish documentation to correct chaining order (#2457)78a4090docs: update comparison withruntypes(#2536)1ecd624Fix prettier981d4b5Add ZodReadonly (#2634)fba438c3.22.0v3.21.4Compare Source
Commits:
22f3cc63.21.4v3.21.3Compare Source
Commits:
14c08d8added more.pipeexamples006e652Fix npm canary action paths pattern (#2148)bdcff0fRemove logging in testsa5830c6Reverted #1564c458381Fix tests2db0dca3.21.3v3.21.2Compare Source
Commits:
b276d71Improve typings in generics4d016b7Improve type inference in genericsf9895abImprove types inside generic functionsac0135ePass input into catchValuev3.21.1Compare Source
Features
Support for ULID validation
Commits:
4f89461Prettierbd6527aUpdate deps126c77baddedtoLowerCaseandtoUpperCaseback in for v3.21.01749657Update README.mddabe63dupdatedz.customexample again :D6b8f655docs: improve cn readme (#2143)9012dc7add.includes(value, options?)@ZodString. (#1887)67b981eMake safeParse().error a getter346fde03.21.0-canary.20230304T235951b50d871Add canary release CIb20cca2Fix canaryf7f5c50Move action to .github/workflowsf01fa0eTry to fix canary CIf5e8067No git tag5b304aeNo dry run20df80eAdd tsc compilation testead93d3Document .pipe()d8e8653Update headers03c0ab1Cache the evaluation of ParseInputLazyPath.path() for a moderate perf improvement (#2137)e7b3b7bImprove string docs83478f5Remove zod dep2f1868dSpecify paths for canarye599966Add sponsors950bd17Tweak x.custom example728e56aClose #212764883e4feat: z.string().ulid() - add support for ulids (#2049)e0d709b3.20.19c33194Remove comments, clean up utils942e2dbFix testsv3.21.0Compare Source
Features
z.string().emoji()Thanks @joseph-lozano for #2045! To validate that all characters in a string are emoji:
...if that's something you want to do for some reason.
z.string().cuid2()Thanks @joulev for #1813! To validate CUIDv2:
z.string().ip()Thanks @fvckDesa for #2066. To validate that a string is a valid IP address:
To specify a particular
version:z.bigint().{gt|gte|lt|lte}()Thanks @igalklebanov for
#1711!ZodBigIntgets the same set of methods found onZodNumber:z.enum(...).extract()andz.enum(...).exclude()Thanks @santosmarco-caribou for #1652! To add or remove elements from a
ZodEnum:This API is inspired by the
ExcludeandExtractTypeScript built-ins.Pass a function to
.catch()Thanks @0xWryth for #2087! The
.catch()method now accepts a function that receives the caught error:Compiler performance
Zod 3.20.2 introduced an accidental type recursion that caused long compilation times for some users. These kinds of bugs are very hard to diagnose. Big shoutout to @gydroperit for some heroic efforts here: #2107 Zod 3.21 resolves these issues:
Commits:
3c54461fix typo in readmec244fb6feat: z.string().emoji() (#2045)39cbb69Fix emoji validation, fix lintd8f07bbFix emoji9b7dd81Improve variable name clarity (#2048)5cec187Add documentation for the param parameter of z.custom654f529Merge pull request #2057 from trygveaa/add-documentation-for-z-custom-params981af65Merge pull request #2019 from vbud/patch-1a7c2969Update error_handling8f3d028BRAND Record to Non Partial (#2097)5ec98e1Fix email issues in pull request #1982 (#2058)7d40ba5feat(#2059): z.string.ip() - add support for IP address (#2066)e559605feat: add.catcherror (#2087)defdab9Fix record tests8de36ebFIX: emoji regex and tests (#2090)16beeb5lowercase method for ZodString (#2038)75cb9e8add checks @ZodBigInt. (#1711)c4d4e49Update ERROR_HANDLING.md (#2022)d6f0890added link to deno land4cf1960Refactoring of ZodFormattedError type to improve tsc check time (#2107)867a921Bump http-cache-semantics from 4.1.0 to 4.1.1 (#1985)edc3a67Deprecate deepPartiale59f639Add custom testsa6b44edRemove logginga1fc3fbcommented outtoLowerCaseandtoUpperCasee71cc52Update README_ZH.md (#2139)3af38fbaddZodNumber.safe()&ZodNumber.isSafe. (#1753)6ef82eeAdd benchmark flags5463593Support brands in recursive types8074523Update readmeb6794a4Add index signature for passthrough3c6cdd2Make generic optional in objectOutputTypebc43ad1Fix rollup build6a0545a3.21.07c07339Fix brand0aa6021Clean up testsv3.20.6Compare Source
Commits:
e6939193.20.6v3.20.5Compare Source
Commits:
e71c7beFix extract/exclude type errorv3.20.4Compare Source
Commits:
b8d731fSet input type of ZodCatch to unknown06c237cRevert merge changesc8ce27e3.20.4v3.20.3Compare Source
Features
ZodNumber.isFinite, makeZodNumber.isInttrue if.multipleOf(int). by @igalklebanov in #1714extract/excludemethods toZodEnumby @santosmarco-caribou in #1652Fixes and documentation
z.coerce. by @igalklebanov in #1680isAsynctype guard by @aaronccasanova in #1719ZodCatchby @santosmarco-caribou in #1733deno/lib/README.mdto matchzod/README.mdby @JacobWeisenburger in #1791.describe()by @rattrayalex in #1819.pick,.omit,.partial&.required. by @igalklebanov in #1875ZodObject's.omit(mask),.pick(mask),.required(mask)&.partial(mask)at compile time. by @igalklebanov in #1564New Contributors
Full Changelog: colinhacks/zod@v3.20.2...v3.20.3
v3.20.2Compare Source
Commits:
d7d49e7Clarify boolean coercionf49cbcbFix formatting0b62f8cRevert email regex changes68919aa3.20.2c9e4ed4Fix string testv3.20.1Compare Source
Commits:
1298d26Update readmeb3b0ecfOnly call .catch() method when parsing fails (#1674)957b55bFixing ZodString::isDatetime. (#1678)29ec1f8Add default1161b8f3.20.1v3.20.0: -betaCompare Source
Breaking changes
There are no breaking API changes, however TypeScript versions
4.4and 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 aZodPipelineinstance.z.coerceZod 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 aZodStringinstance 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 aZodCatchinstance.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
ZodStringto 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
offsetparameter.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
maskparameter to.requiredmethod by @SrBrahma in #1315fataltoZodIssue. by @igalklebanov in #1555.finite()@ZodNumber. by @igalklebanov in #1546.required()doesn't remove optional flag from the result of.nullish(). by @igalklebanov in #1542datetime()string formats by @samchungy in #1494pathparameter into account within.parseAsync()by @RobinTail in #1513ZodSymbolby @santosmarco-caribou in #1448New Contributors
Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ 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 was generated by Mend Renovate. View the repository job log.