mrtousif / youtube-clone

NestJS, Hasura, Postgres, React, RefineJS, Kubernetes, FusionAuth
10 stars 1 forks source link

fix(deps): update dependency zod to v3.22.3 [security] #186

Open renovate[bot] opened 1 year ago

renovate[bot] commented 1 year ago

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
zod (source) 3.20.6 -> 3.22.3 age adoption passing confidence

GitHub 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.3`](https://redirect.github.com/colinhacks/zod/releases/tag/v3.22.3) [Compare Source](https://redirect.github.com/colinhacks/zod/compare/v3.22.2...v3.22.3) ##### Commits: - [`1e23990`](https://redirect.github.com/colinhacks/zod/commit/1e23990bcdd33d1e81b31e40e77a031fcfd87ce1) Commit - [`9bd3879`](https://redirect.github.com/colinhacks/zod/commit/9bd3879b482f139fd03d5025813ee66a04195cdd) docs: remove obsolete text about readonly types ([#​2676](https://redirect.github.com/colinhacks/zod/issues/2676)) - [`f59be09`](https://redirect.github.com/colinhacks/zod/commit/f59be093ec21430d9f32bbcb628d7e39116adf34) clarify datetime ISO 8601 ([#​2673](https://redirect.github.com/colinhacks/zod/issues/2673)) - [`64dcc8e`](https://redirect.github.com/colinhacks/zod/commit/64dcc8e2b16febe48fa8e3c82c47c92643e6c9e3) Update sponsors - [`18115a8`](https://redirect.github.com/colinhacks/zod/commit/18115a8f128680b4526df58ce96deab7dce93b93) Formatting - [`28c1927`](https://redirect.github.com/colinhacks/zod/commit/28c19273658b164c53c149785fa7a8187c428ad4) Update sponsors - [`ad2ee9c`](https://redirect.github.com/colinhacks/zod/commit/ad2ee9ccf723c4388158ff6b8669c2a6cdc85643) 2718 Updated Custom Schemas documentation example to use type narrowing ([#​2778](https://redirect.github.com/colinhacks/zod/issues/2778)) - [`ae0f7a2`](https://redirect.github.com/colinhacks/zod/commit/ae0f7a2c15e7741ee1b23c03a3bfb9acebd86551) docs: update ref to discriminated-unions docs ([#​2485](https://redirect.github.com/colinhacks/zod/issues/2485)) - [`2ba00fe`](https://redirect.github.com/colinhacks/zod/commit/2ba00fe2377f4d53947a84b8cdb314a63bbd6dd4) \[2609] fix ReDoS vulnerability in email regex ([#​2824](https://redirect.github.com/colinhacks/zod/issues/2824)) - [`1e61d76`](https://redirect.github.com/colinhacks/zod/commit/1e61d76cdec05de9271fc0df58798ddf9ce94923) 3.22.3 ### [`v3.22.2`](https://redirect.github.com/colinhacks/zod/releases/tag/v3.22.2) [Compare Source](https://redirect.github.com/colinhacks/zod/compare/v3.22.1...v3.22.2) ##### Commits: - [`13d9e6b`](https://redirect.github.com/colinhacks/zod/commit/13d9e6bda286cbd4c1b177171273695d8309e5de) Fix lint - [`0d49f10`](https://redirect.github.com/colinhacks/zod/commit/0d49f10b3c25a8e4cbb6534cc0773b195c56d06d) docs: add typeschema to ecosystem ([#​2626](https://redirect.github.com/colinhacks/zod/issues/2626)) - [`8e4af7b`](https://redirect.github.com/colinhacks/zod/commit/8e4af7b56df6f2e3daf0dd825b986f1d963025ce) X to Zod: add app.quicktype.io ([#​2668](https://redirect.github.com/colinhacks/zod/issues/2668)) - [`792b3ef`](https://redirect.github.com/colinhacks/zod/commit/792b3ef0d41c144cd10641c6966b98dae1222d82) Fix superrefine types ### [`v3.22.1`](https://redirect.github.com/colinhacks/zod/releases/tag/v3.22.1) [Compare Source](https://redirect.github.com/colinhacks/zod/compare/v3.22.0...v3.22.1) #### Commits: Fix handing of `this` in ZodFunction schemas. The parse logic for function schemas now requires the `Reflect` API. ```ts const methodObject = z.object({ property: z.number(), method: z.function().args(z.string()).returns(z.number()), }); const methodInstance = { property: 3, method: function (s: string) { return s.length + this.property; }, }; const parsed = methodObject.parse(methodInstance); parsed.method("length=8"); // => 11 (8 length + 3 property) ``` - [`932cc47`](https://redirect.github.com/colinhacks/zod/commit/932cc472d2e66430d368a409b8d251909d7d8d21) Initial prototype fix for issue [#​2651](https://redirect.github.com/colinhacks/zod/issues/2651) ([#​2652](https://redirect.github.com/colinhacks/zod/issues/2652)) - [`0a055e7`](https://redirect.github.com/colinhacks/zod/commit/0a055e726ac210ef6efc69aa70cd2491767f6060) 3.22.1 ### [`v3.22.0`](https://redirect.github.com/colinhacks/zod/releases/tag/v3.22.0) [Compare Source](https://redirect.github.com/colinhacks/zod/compare/v3.21.4...v3.22.0) #### `ZodReadonly` This release introduces `ZodReadonly` and the `.readonly()` method on `ZodType`. Calling `.readonly()` on any schema returns a `ZodReadonly` instance that wraps the original schema. The new schema parses all inputs using the original schema, then calls `Object.freeze()` on the result. The inferred type is also marked as `readonly`. ```ts const schema = z.object({ name: string }).readonly(); type schema = z.infer; // Readonly<{name: string}> const result = schema.parse({ name: "fido" }); result.name = "simba"; // error ``` The inferred type uses TypeScript's built-in readonly types when relevant. ```ts z.array(z.string()).readonly(); // readonly string[] z.tuple([z.string(), z.number()]).readonly(); // readonly [string, number] z.map(z.string(), z.date()).readonly(); // ReadonlyMap z.set(z.string()).readonly(); // ReadonlySet> ``` #### Commits: - [`6dad907`](https://redirect.github.com/colinhacks/zod/commit/6dad90785398885f7b058f5c0760d5ae5476b833) Comments - [`56ace68`](https://redirect.github.com/colinhacks/zod/commit/56ace682e4cc89132c034a3ae2c13b2d5b1a0115) Fix deno test - [`3809d54`](https://redirect.github.com/colinhacks/zod/commit/3809d54fc8c5dd0a0ce367bd2575fe3fdadf087d) Add superforms - [`d1ad522`](https://redirect.github.com/colinhacks/zod/commit/d1ad5221900af640bc3093a2fb0476ec0c94953e) Add transloadit - [`a3bb701`](https://redirect.github.com/colinhacks/zod/commit/a3bb701757127ffe05e773a2e449136b9b7efcb3) Testing on Typescript 5.0 ([#​2221](https://redirect.github.com/colinhacks/zod/issues/2221)) - [`51e14be`](https://redirect.github.com/colinhacks/zod/commit/51e14beeab2f469fcbf18e3df44653e1643f5487) docs: update deprecated link ([#​2219](https://redirect.github.com/colinhacks/zod/issues/2219)) - [`a263814`](https://redirect.github.com/colinhacks/zod/commit/a263814fc430db8d47430cd2884d2cea6b11c671) fixed Datetime & IP TOC links - [`502384e`](https://redirect.github.com/colinhacks/zod/commit/502384e56fe2b1f8173735df6c3b0d41bce04edc) docs: add mobx-zod-form to form integrations ([#​2299](https://redirect.github.com/colinhacks/zod/issues/2299)) - [`a8be450`](https://redirect.github.com/colinhacks/zod/commit/a8be4500851923aa865e009fe9c2855e80482047) docs: Add `zocker` to Ecosystem section ([#​2416](https://redirect.github.com/colinhacks/zod/issues/2416)) - [`15de22a`](https://redirect.github.com/colinhacks/zod/commit/15de22a3ba6144c7d8d2276e8e56174bcdfa7225) Allow subdomains and hyphens in `ZodString.email` ([#​2274](https://redirect.github.com/colinhacks/zod/issues/2274)) - [`00f5783`](https://redirect.github.com/colinhacks/zod/commit/00f5783602ccbe423deb0dbd76ecf13a276bc54d) Add `zod-openapi` to ecosystem ([#​2434](https://redirect.github.com/colinhacks/zod/issues/2434)) - [`0a17340`](https://redirect.github.com/colinhacks/zod/commit/0a17340e9fc4b909d10ca3687b6bc6454903ff21) docs: fix minor typo ([#​2439](https://redirect.github.com/colinhacks/zod/issues/2439)) - [`60a2134`](https://redirect.github.com/colinhacks/zod/commit/60a21346086d32ca9f39efc2771f5db37c835c03) Add masterborn - [`0a90ed1`](https://redirect.github.com/colinhacks/zod/commit/0a90ed1461dafa62ff50ce0d5d5434fd4a2a4a20) chore: move `exports.types` field to first spot @​ package.json. ([#​2443](https://redirect.github.com/colinhacks/zod/issues/2443)) - [`67f35b1`](https://redirect.github.com/colinhacks/zod/commit/67f35b16692ca33fd48adfec9ae83b9514f8a4b7) docs: allow Zod to be used in dev tools at site ([#​2432](https://redirect.github.com/colinhacks/zod/issues/2432)) - [`6795c57`](https://redirect.github.com/colinhacks/zod/commit/6795c574b1d34f6e95ae891f96d8b219b98ace92) Fix not working Deno doc link. ([#​2428](https://redirect.github.com/colinhacks/zod/issues/2428)) - [`37e9c55`](https://redirect.github.com/colinhacks/zod/commit/37e9c550460e4edd144da90d903e878c119c5cc1) Generalize uuidRegex - [`0969950`](https://redirect.github.com/colinhacks/zod/commit/09699501ff6218b3b0a7e382eca3c02a8226ce13) adds ctx to preprocess ([#​2426](https://redirect.github.com/colinhacks/zod/issues/2426)) - [`af08390`](https://redirect.github.com/colinhacks/zod/commit/af08390139cf9fd4fc9e398b60a39191bf224076) fix: super refinement function types ([#​2420](https://redirect.github.com/colinhacks/zod/issues/2420)) - [`36fef58`](https://redirect.github.com/colinhacks/zod/commit/36fef58410f4b2c9e79edabae2fc567a4aee13a7) Make email regex reasonable ([#​2157](https://redirect.github.com/colinhacks/zod/issues/2157)) - [`f627d14`](https://redirect.github.com/colinhacks/zod/commit/f627d14d3bfe3a680ac0d54705b2e63daa912aed) Document canary - [`e06321c`](https://redirect.github.com/colinhacks/zod/commit/e06321c15d22082e47c7c111a92ec7b3e104c644) docs: add tapiduck to API libraries ([#​2410](https://redirect.github.com/colinhacks/zod/issues/2410)) - [`11e507c`](https://redirect.github.com/colinhacks/zod/commit/11e507c4d3bf4ad3ab2057a0122168ed0048a2c4) docs: add ts as const example in zod enums ([#​2412](https://redirect.github.com/colinhacks/zod/issues/2412)) - [`5427565`](https://redirect.github.com/colinhacks/zod/commit/5427565c347a14056bc60e3ffd800b98753952bc) docs: add zod-fixture to mocking ecosystem ([#​2409](https://redirect.github.com/colinhacks/zod/issues/2409)) - [`d3bf7e6`](https://redirect.github.com/colinhacks/zod/commit/d3bf7e60a8eb706c4c63a9a91fd66565b82883cf) docs: add `zodock` to mocking ecosystem ([#​2394](https://redirect.github.com/colinhacks/zod/issues/2394)) - [`2270ae5`](https://redirect.github.com/colinhacks/zod/commit/2270ae563f7f14bed770f75d9c252880794fa71f) remove "as any" casts in createZodEnum ([#​2332](https://redirect.github.com/colinhacks/zod/issues/2332)) - [`00bdd0a`](https://redirect.github.com/colinhacks/zod/commit/00bdd0a7ffdf495af14e67ae1396c85a282c38dd) fix proto pollution vulnerability ([#​2239](https://redirect.github.com/colinhacks/zod/issues/2239)) - [`a3c5256`](https://redirect.github.com/colinhacks/zod/commit/a3c525658bc43edf40747a99b8f882d8d3d1e0c7) Fix error_handling unrecognized_keys example - [`4f75cbc`](https://redirect.github.com/colinhacks/zod/commit/4f75cbc682199a5411189f9cd9abba9af4924746) Adds getters to Map for key + value ([#​2356](https://redirect.github.com/colinhacks/zod/issues/2356)) - [`ca7b032`](https://redirect.github.com/colinhacks/zod/commit/ca7b03222764496d72085b1178fa22f4a57fe579) FMC ([#​2346](https://redirect.github.com/colinhacks/zod/issues/2346)) - [`6fec8bd`](https://redirect.github.com/colinhacks/zod/commit/6fec8bd3407f463f157522a3979b4d202870ba4c) docs: fix typo in link fragment ([#​2329](https://redirect.github.com/colinhacks/zod/issues/2329)) - [`16f90bd`](https://redirect.github.com/colinhacks/zod/commit/16f90bd22b465aca9a1fbad09248d80aa93fd824) Update README.md - [`2c80250`](https://redirect.github.com/colinhacks/zod/commit/2c802507d92d2d2e15be959695b1de78b896bfcb) Update readme - [`eaf64e0`](https://redirect.github.com/colinhacks/zod/commit/eaf64e09ba1a87dd6bf348fb97061894a01242d2) Update sponsors - [`c576311`](https://redirect.github.com/colinhacks/zod/commit/c5763112e2912390f3317d738e4261fa8747494e) Update readme - [`5e23b4f`](https://redirect.github.com/colinhacks/zod/commit/5e23b4fae4715c7391f9ceb4369421a034851b4c) Add `*.md` pattern to prettier ([#​2476](https://redirect.github.com/colinhacks/zod/issues/2476)) - [`898dced`](https://redirect.github.com/colinhacks/zod/commit/898dced470f1045b5469543abd2f427a713d93eb) Revamp tests - [`6309322`](https://redirect.github.com/colinhacks/zod/commit/6309322a28545e316299f8b9a36f43132d347300) Update test runners - [`c0aece1`](https://redirect.github.com/colinhacks/zod/commit/c0aece1672d1442d69ce1991142af8f16ed20ecb) Add vitest config - [`73a5610`](https://redirect.github.com/colinhacks/zod/commit/73a5610186c413872153e8dcac76c4c4f23dfe4e) Update script - [`8d8e1a2`](https://redirect.github.com/colinhacks/zod/commit/8d8e1a2d306cecaf3d8cb88f32fe3e130a834f9f) Fix deno test bug - [`9eb2508`](https://redirect.github.com/colinhacks/zod/commit/9eb2508fac78cc36faefd050e9616bb6d34814c1) Clean up configs - [`cfbc7b3`](https://redirect.github.com/colinhacks/zod/commit/cfbc7b3f6714ced250dd4053822faf472bf1828e) Fix root jest config - [`8677f68`](https://redirect.github.com/colinhacks/zod/commit/8677f688b0ab1bb5991e90744f46a15082772bd6) docs(comparison-yup): Yup added partial() and deepPartial() in v1 ([#​2603](https://redirect.github.com/colinhacks/zod/issues/2603)) - [`fb00edd`](https://redirect.github.com/colinhacks/zod/commit/fb00edd04ca338b8d791a96dead161076538c6c2) docs: add VeeValidate form library for Vue.js ([#​2578](https://redirect.github.com/colinhacks/zod/issues/2578)) - [`ab8e717`](https://redirect.github.com/colinhacks/zod/commit/ab8e71793431eeb163613007c134132e6c2ab078) docs: fix typo in z.object ([#​2570](https://redirect.github.com/colinhacks/zod/issues/2570)) - [`d870407`](https://redirect.github.com/colinhacks/zod/commit/d870407a020f9518fbae662f9f48a9aba005a3e2) docs: fix incomplete Records example ([#​2579](https://redirect.github.com/colinhacks/zod/issues/2579)) - [`5adae24`](https://redirect.github.com/colinhacks/zod/commit/5adae24e9b2fc98fc679defa8f78e4142d4c3451) docs: add conform form integration ([#​2577](https://redirect.github.com/colinhacks/zod/issues/2577)) - [`8b8ab3e`](https://redirect.github.com/colinhacks/zod/commit/8b8ab3e79691ebafbb9aac3ce089eaf0dcd6d8fe) Update README.md ([#​2562](https://redirect.github.com/colinhacks/zod/issues/2562)) - [`6aab901`](https://redirect.github.com/colinhacks/zod/commit/6aab9016873c12be08d19bcc097b3e5ba4c9d6fe) fix typo test name ([#​2542](https://redirect.github.com/colinhacks/zod/issues/2542)) - [`81a89f5`](https://redirect.github.com/colinhacks/zod/commit/81a89f593f4d6b05f770bbb3ad0fc98075f468dd) Update nullish documentation to correct chaining order ([#​2457](https://redirect.github.com/colinhacks/zod/issues/2457)) - [`78a4090`](https://redirect.github.com/colinhacks/zod/commit/78a409012a4dc34a455f5c4a7e028ca47c921e1b) docs: update comparison with `runtypes` ([#​2536](https://redirect.github.com/colinhacks/zod/issues/2536)) - [`1ecd624`](https://redirect.github.com/colinhacks/zod/commit/1ecd6241ef97b33ce229b49f1346ffeee5d0ba74) Fix prettier - [`981d4b5`](https://redirect.github.com/colinhacks/zod/commit/981d4b5e272e7e35ff44a31fbb5e8e90594b1933) Add ZodReadonly ([#​2634](https://redirect.github.com/colinhacks/zod/issues/2634)) - [`fba438c`](https://redirect.github.com/colinhacks/zod/commit/fba438cddea800b081a15aefc8b1efea2eccf7af) 3.22.0 ### [`v3.21.4`](https://redirect.github.com/colinhacks/zod/releases/tag/v3.21.4) [Compare Source](https://redirect.github.com/colinhacks/zod/compare/v3.21.3...v3.21.4) #### Commits: - [`22f3cc6`](https://redirect.github.com/colinhacks/zod/commit/22f3cc6ed52a28c984a0319a1a03e1af244cee02) 3.21.4 ### [`v3.21.3`](https://redirect.github.com/colinhacks/zod/releases/tag/v3.21.3) [Compare Source](https://redirect.github.com/colinhacks/zod/compare/v3.21.2...v3.21.3) #### Commits: - [`14c08d8`](https://redirect.github.com/colinhacks/zod/commit/14c08d87129c3b652f03d2e724979c383c55e0b4) added more `.pipe` examples - [`006e652`](https://redirect.github.com/colinhacks/zod/commit/006e6521f425b38e1fbb898e29921fe885caf7ba) Fix npm canary action paths pattern ([#​2148](https://redirect.github.com/colinhacks/zod/issues/2148)) - [`bdcff0f`](https://redirect.github.com/colinhacks/zod/commit/bdcff0f20f4c35dd6a44b1324711dfd34a41ae96) Remove logging in tests - [`a5830c6`](https://redirect.github.com/colinhacks/zod/commit/a5830c6d3fe28f0d5435cc9ff22846be7f5977c1) Reverted [#​1564](https://redirect.github.com/colinhacks/zod/issues/1564) - [`c458381`](https://redirect.github.com/colinhacks/zod/commit/c4583819e77a702e21b587c4bf081d0292f2b754) Fix tests - [`2db0dca`](https://redirect.github.com/colinhacks/zod/commit/2db0dcadc961fd57f7f10f9d9f55d67e6d040342) 3.21.3 ### [`v3.21.2`](https://redirect.github.com/colinhacks/zod/releases/tag/v3.21.2) [Compare Source](https://redirect.github.com/colinhacks/zod/compare/v3.21.1...v3.21.2) #### Commits: - [`b276d71`](https://redirect.github.com/colinhacks/zod/commit/b276d71eaefef6cb87c81e8429bd160e4b68c168) Improve typings in generics - [`4d016b7`](https://redirect.github.com/colinhacks/zod/commit/4d016b772b79d566bfa2a0c2fc5bfbd92b776982) Improve type inference in generics - [`f9895ab`](https://redirect.github.com/colinhacks/zod/commit/f9895ab1650ef3df9c598a8c43ede0160596ac2e) Improve types inside generic functions - [`ac0135e`](https://redirect.github.com/colinhacks/zod/commit/ac0135e00df75abd57a93a4816fe0fdaa31e94e8) Pass input into catchValue ### [`v3.21.1`](https://redirect.github.com/colinhacks/zod/releases/tag/v3.21.1) [Compare Source](https://redirect.github.com/colinhacks/zod/compare/v3.21.0...v3.21.1) #### Features Support for [ULID](https://redirect.github.com/ulid/spec) validation ```ts z.string().ulid(); ``` #### Commits: - [`4f89461`](https://redirect.github.com/colinhacks/zod/commit/4f8946182ee07eb7b5d40efa908b1715414e8929) Prettier - [`bd6527a`](https://redirect.github.com/colinhacks/zod/commit/bd6527a47a4626135dccac113a7b09f81b675edd) Update deps - [`126c77b`](https://redirect.github.com/colinhacks/zod/commit/126c77b3130d9a68032f72ac76dd9e1ccfd86c2c) added `toLowerCase` and `toUpperCase` back in for v3.21.0 - [`1749657`](https://redirect.github.com/colinhacks/zod/commit/174965739d17db348d445ab250fb2cf6bd7cdd51) Update README.md - [`dabe63d`](https://redirect.github.com/colinhacks/zod/commit/dabe63d15eb6d22246aa5d5c83b69d1d5f4c2f4b) updated `z.custom` example again :D - [`6b8f655`](https://redirect.github.com/colinhacks/zod/commit/6b8f6557d9b53ea7ad3fda753a51cdf153ba1fb7) docs: improve cn readme ([#​2143](https://redirect.github.com/colinhacks/zod/issues/2143)) - [`9012dc7`](https://redirect.github.com/colinhacks/zod/commit/9012dc7055e1467b6d619a6c0ad016fdfbde2b9c) add `.includes(value, options?)` @​ `ZodString`. ([#​1887](https://redirect.github.com/colinhacks/zod/issues/1887)) - [`67b981e`](https://redirect.github.com/colinhacks/zod/commit/67b981e70b4bacb2278a9aacd22d38cbb4b52d17) Make safeParse().error a getter - [`346fde0`](https://redirect.github.com/colinhacks/zod/commit/346fde03724bfd1601823e4f72470bc7e344030b) 3.21.0-canary.20230304T235951 - [`b50d871`](https://redirect.github.com/colinhacks/zod/commit/b50d871b2f5949587afdcce2375227a447dbb742) Add canary release CI - [`b20cca2`](https://redirect.github.com/colinhacks/zod/commit/b20cca230a6a9beb8acf841250641b62847b6e80) Fix canary - [`f7f5c50`](https://redirect.github.com/colinhacks/zod/commit/f7f5c50c65d7c7e5262c028e6832b92b14d84ea5) Move action to .github/workflows - [`f01fa0e`](https://redirect.github.com/colinhacks/zod/commit/f01fa0e48ca18630604366f5bc7401a18eb4d018) Try to fix canary CI - [`f5e8067`](https://redirect.github.com/colinhacks/zod/commit/f5e8067b2afcc3e5ae9f8ed389a31b83a7c3ceec) No git tag - [`5b304ae`](https://redirect.github.com/colinhacks/zod/commit/5b304ae41705105ae6edcacdb6dfdac9c527b3f4) No dry run - [`20df80e`](https://redirect.github.com/colinhacks/zod/commit/20df80e6ce2ac27f6e2f26b61cd1fd4c942b152d) Add tsc compilation test - [`ead93d3`](https://redirect.github.com/colinhacks/zod/commit/ead93d3cfde54efe952dc615c21ff179a00f7574) Document .pipe() - [`d8e8653`](https://redirect.github.com/colinhacks/zod/commit/d8e86534325fb00bc0193a4c6af04f2a67bd2e4e) Update headers - [`03c0ab1`](https://redirect.github.com/colinhacks/zod/commit/03c0ab1640ca9111d9fbac3c261e2f76e3cbf247) Cache the evaluation of ParseInputLazyPath.path() for a moderate perf improvement ([#​2137](https://redirect.github.com/colinhacks/zod/issues/2137)) - [`e7b3b7b`](https://redirect.github.com/colinhacks/zod/commit/e7b3b7bf493caeee7e4f043eea024e4d3badc090) Improve string docs - [`83478f5`](https://redirect.github.com/colinhacks/zod/commit/83478f5e413c333f07f53b9b4bb8c24b75e1cecf) Remove zod dep - [`2f1868d`](https://redirect.github.com/colinhacks/zod/commit/2f1868d0c17c0e401c4438d9d35e68f9685a741b) Specify paths for canary - [`e599966`](https://redirect.github.com/colinhacks/zod/commit/e599966709fe0253d6779ce1dec38a2adcebf41f) Add sponsors - [`950bd17`](https://redirect.github.com/colinhacks/zod/commit/950bd17f01668b45e592a678974437b15012b158) Tweak x.custom example - [`728e56a`](https://redirect.github.com/colinhacks/zod/commit/728e56a7e157cca8cdc0ab937f25a2412673c934) Close [#​2127](https://redirect.github.com/colinhacks/zod/issues/2127) - [`64883e4`](https://redirect.github.com/colinhacks/zod/commit/64883e4fe41b10eb577c4f9eaf6f24fa29bcd60d) feat: z.string().ulid() - add support for ulids ([#​2049](https://redirect.github.com/colinhacks/zod/issues/2049)) - [`e0d709b`](https://redirect.github.com/colinhacks/zod/commit/e0d709b1348efab06ac5341d360a411bc09eb7ba) 3.20.1 - [`9c33194`](https://redirect.github.com/colinhacks/zod/commit/9c3319443cfc953adc51786e8d6fe0bbe1e37f8e) Remove comments, clean up utils - [`942e2db`](https://redirect.github.com/colinhacks/zod/commit/942e2db8e51d580f4e3cd8c4c4af8bc6aecf4130) Fix tests ### [`v3.21.0`](https://redirect.github.com/colinhacks/zod/releases/tag/v3.21.0) [Compare Source](https://redirect.github.com/colinhacks/zod/compare/v3.20.6...v3.21.0) #### Features ##### `z.string().emoji()` Thanks [@​joseph-lozano](https://redirect.github.com/joseph-lozano) for [https://github.com/colinhacks/zod/pull/2045](https://redirect.github.com/colinhacks/zod/pull/2045)! To validate that all characters in a string are emoji: ```ts z.string().emoji() ``` ...if that's something you want to do for some reason. ##### `z.string().cuid2()` Thanks [@​joulev](https://redirect.github.com/joulev) for [https://github.com/colinhacks/zod/pull/1813](https://redirect.github.com/colinhacks/zod/pull/1813)! To validate [CUIDv2](https://redirect.github.com/paralleldrive/cuid2): ```ts z.string().cuid2() ``` ##### `z.string().ip()` Thanks [@​fvckDesa](https://redirect.github.com/fvckDesa) for [https://github.com/colinhacks/zod/pull/2066](https://redirect.github.com/colinhacks/zod/pull/2066). To validate that a string is a valid IP address: ```ts const v4IP = "122.122.122.122"; const v6IP = "6097:adfa:6f0b:220d:db08:5021:6191:7990"; // matches both IPv4 and IPv6 by default const ipSchema = z.string().ip(); ipSchema.parse(v4IP) // pass ipSchema.parse(v6IP) // pass ``` To specify a particular `version`: ```ts const ipv4Schema = z.string().ip({ version: "v4" }); const ipv6Schema = z.string().ip({ version: "v6" }); ``` ##### `z.bigint().{gt|gte|lt|lte}()` Thanks [@​igalklebanov](https://redirect.github.com/igalklebanov) for [`#1711`](https://redirect.github.com/colinhacks/zod/pull/1711)! `ZodBigInt` gets the same set of methods found on `ZodNumber`: ```ts z.bigint().gt(BigInt(5)); z.bigint().gte(BigInt(5)); z.bigint().lt(BigInt(5)); z.bigint().lte(BigInt(5)); z.bigint().positive(); z.bigint().negative(); z.bigint().nonnegative(); z.bigint().nonpositive(); z.bigint().multipleOf(BigInt(5)); ``` ##### `z.enum(...).extract()` and `z.enum(...).exclude()` Thanks [@​santosmarco-caribou](https://redirect.github.com/santosmarco-caribou) for [https://github.com/colinhacks/zod/pull/1652](https://redirect.github.com/colinhacks/zod/pull/1652)! To add or remove elements from a `ZodEnum`: ```ts const FoodEnum = z.enum(["Pasta", "Pizza", "Tacos", "Burgers", "Salad"]); const ItalianEnum = FoodEnum.extract(["Pasta", "Pizza"]); // ZodEnum<["Pasta", "Pizza"]> const UnhealthyEnum = FoodEnum.exclude(["Salad"]); // ZodEnum<["Pasta", "Pizza", "Tacos", "Burgers"]> ``` This API is inspired by the [`Exclude`](https://www.typescriptlang.org/docs/handbook/utility-types.html#excludeuniontype-excludedmembers) and [`Extract`](https://www.typescriptlang.org/docs/handbook/utility-types.html#extracttype-union) TypeScript built-ins. ##### Pass a function to `.catch()` Thanks [@​0xWryth](https://redirect.github.com/0xWryth) for [https://github.com/colinhacks/zod/pull/2087](https://redirect.github.com/colinhacks/zod/pull/2087)! The `.catch()` method now accepts a function that receives the caught error: ```ts const numberWithErrorCatch = z.number().catch((ctx) => { ctx.error; // ZodError return 42; }); ``` #### 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](https://redirect.github.com/gydroperit) for some heroic efforts here: [https://github.com/colinhacks/zod/pull/2107](https://redirect.github.com/colinhacks/zod/pull/2107) Zod 3.21 resolves these issues: - [https://github.com/colinhacks/zod/issues/2142](https://redirect.github.com/colinhacks/zod/issues/2142) - [https://github.com/colinhacks/zod/issues/1741](https://redirect.github.com/colinhacks/zod/issues/1741) - https://stackoverflow.com/questions/74881472/slow-typescript-autocompletion-in-vs-code-for-zod #### Commits: - [`3c54461`](https://redirect.github.com/colinhacks/zod/commit/3c54461d7a649bf727aec59367eefb214ffe24fe) fix typo in readme - [`c244fb6`](https://redirect.github.com/colinhacks/zod/commit/c244fb6c57506fd11609106960639de26ddf9b6d) feat: z.string().emoji() ([#​2045](https://redirect.github.com/colinhacks/zod/issues/2045)) - [`39cbb69`](https://redirect.github.com/colinhacks/zod/commit/39cbb6971c3dca09cbc0acdca2d3995dfd26aab2) Fix emoji validation, fix lint - [`d8f07bb`](https://redirect.github.com/colinhacks/zod/commit/d8f07bbfffd255b0aee6b5fe9bb6aa2bce6586af) Fix emoji - [`9b7dd81`](https://redirect.github.com/colinhacks/zod/commit/9b7dd816e92e16ca735e488b77e280a92a84ed64) Improve variable name clarity ([#​2048](https://redirect.github.com/colinhacks/zod/issues/2048)) - [`5cec187`](https://redirect.github.com/colinhacks/zod/commit/5cec1871ac21627608af6c07585d5e50ff30f281) Add documentation for the param parameter of z.custom - [`654f529`](https://redirect.github.com/colinhacks/zod/commit/654f52969a968c630af816dcad0d8f3721f9001a) Merge pull request [#​2057](https://redirect.github.com/colinhacks/zod/issues/2057) from trygveaa/add-documentation-for-z-custom-params - [`981af65`](https://redirect.github.com/colinhacks/zod/commit/981af6503ee1be530fe525ac77ba95e1904ce24a) Merge pull request [#​2019](https://redirect.github.com/colinhacks/zod/issues/2019) from vbud/patch-1 - [`a7c2969`](https://redirect.github.com/colinhacks/zod/commit/a7c2969b9125df0fbfa65e8541a974eeaf53b6a6) Update error_handling - [`8f3d028`](https://redirect.github.com/colinhacks/zod/commit/8f3d0283ba75d146d5199fe3dc140eeb5402352c) BRAND Record to Non Partial ([#​2097](https://redirect.github.com/colinhacks/zod/issues/2097)) - [`5ec98e1`](https://redirect.github.com/colinhacks/zod/commit/5ec98e1c4420957f93a7388bf49fb01d91bcbcd0) Fix email issues in pull request [#​1982](https://redirect.github.com/colinhacks/zod/issues/1982) ([#​2058](https://redirect.github.com/colinhacks/zod/issues/2058)) - [`7d40ba5`](https://redirect.github.com/colinhacks/zod/commit/7d40ba58931130ec965be9d65d14e0665ee9c379) feat([#​2059](https://redirect.github.com/colinhacks/zod/issues/2059)): z.string.ip() - add support for IP address ([#​2066](https://redirect.github.com/colinhacks/zod/issues/2066)) - [`e559605`](https://redirect.github.com/colinhacks/zod/commit/e5596054cfddf8aa1ba8d7d3bad63552a2bf9b6a) feat: add `.catch` error ([#​2087](https://redirect.github.com/colinhacks/zod/issues/2087)) - [`defdab9`](https://redirect.github.com/colinhacks/zod/commit/defdab9c163d9a994f927a0644ab4ec172513fcb) Fix record tests - [`8de36eb`](https://redirect.github.com/colinhacks/zod/commit/8de36eb17d9477ada75cea2164d6b47079dd0444) FIX: emoji regex and tests ([#​2090](https://redirect.github.com/colinhacks/zod/issues/2090)) - [`16beeb5`](https://redirect.github.com/colinhacks/zod/commit/16beeb598039b33bc5a209956042d858abacca34) lowercase method for ZodString ([#​2038](https://redirect.github.com/colinhacks/zod/issues/2038)) - [`75cb9e8`](https://redirect.github.com/colinhacks/zod/commit/75cb9e814115a35c0b4cc2e970f6aaae90e1a13c) add checks @​ `ZodBigInt`. ([#​1711](https://redirect.github.com/colinhacks/zod/issues/1711)) - [`c4d4e49`](https://redirect.github.com/colinhacks/zod/commit/c4d4e494227aadc752d4d5a5a317ec16bb6f5a45) Update ERROR_HANDLING.md ([#​2022](https://redirect.github.com/colinhacks/zod/issues/2022)) - [`d6f0890`](https://redirect.github.com/colinhacks/zod/commit/d6f08908b17ea10456befc2231a867d5cea02a0e) added link to deno land - [`4cf1960`](https://redirect.github.com/colinhacks/zod/commit/4cf19606870e66bf4307984bf99a4bef495c7818) Refactoring of ZodFormattedError type to improve tsc check time ([#​2107](https://redirect.github.com/colinhacks/zod/issues/2107)) - [`867a921`](https://redirect.github.com/colinhacks/zod/commit/867a921a93160780d9f3aeddabf1ca49758a3c1e) Bump http-cache-semantics from 4.1.0 to 4.1.1 ([#​1985](https://redirect.github.com/colinhacks/zod/issues/1985)) - [`edc3a67`](https://redirect.github.com/colinhacks/zod/commit/edc3a67e77d33979b3ee9e071557b4ca53298c55) Deprecate deepPartial - [`e59f639`](https://redirect.github.com/colinhacks/zod/commit/e59f639d3bb5cca65ef239d5dd5c93e74ce4a801) Add custom tests - [`a6b44ed`](https://redirect.github.com/colinhacks/zod/commit/a6b44ed8e346af2fabbb62b5164b99a387accd32) Remove logging - [`a1fc3fb`](https://redirect.github.com/colinhacks/zod/commit/a1fc3fb815051beb4b7030969828aa6abe469c2c) commented out `toLowerCase` and `toUpperCase` - [`e71cc52`](https://redirect.github.com/colinhacks/zod/commit/e71cc523b1865568c4db45f82789e5c86bed0f12) Update README_ZH.md ([#​2139](https://redirect.github.com/colinhacks/zod/issues/2139)) - [`3af38fb`](https://redirect.github.com/colinhacks/zod/commit/3af38fbe2cb114219e688103e41e382e28ec7a80) add `ZodNumber.safe()` & `ZodNumber.isSafe`. ([#​1753](https://redirect.github.com/colinhacks/zod/issues/1753)) - [`6ef82ee`](https://redirect.github.com/colinhacks/zod/commit/6ef82ee1e45dbcfc92a2ed359b1d2ae87d54c43d) Add benchmark flags - [`5463593`](https://redirect.github.com/colinhacks/zod/commit/5463593385549452768e060a98cc0fd8988760d2) Support brands in recursive types - [`8074523`](https://redirect.github.com/colinhacks/zod/commit/80745238937adc06c5b4eab19ef273ca9f7f2de8) Update readme - [`b6794a4`](https://redirect.github.com/colinhacks/zod/commit/b6794a4981b8621fee84642f5313464f5e8f9a22) Add index signature for passthrough - [`3c6cdd2`](https://redirect.github.com/colinhacks/zod/commit/3c6cdd245ab73d7ca1461a18b5be2da07abe6b6b) Make generic optional in objectOutputType - [`bc43ad1`](https://redirect.github.com/colinhacks/zod/commit/bc43ad18e64cf7add23e90bc6b07d5bba8370e5e) Fix rollup build - [`6a0545a`](https://redirect.github.com/colinhacks/zod/commit/6a0545acd5b9cfc40b0b3f04e64bfc5dd789d1b1) 3.21.0 - [`7c07339`](https://redirect.github.com/colinhacks/zod/commit/7c0733968d64c7d7aebc1ae54ca90aadcb2bffc3) Fix brand - [`0aa6021`](https://redirect.github.com/colinhacks/zod/commit/0aa6021ef3628bb39715bdda416be2c6a4951141) Clean up tests

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 is behind base branch, 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.

coderabbitai[bot] commented 2 months ago

[!IMPORTANT]

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


🪧 Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit , please review it.` - `Generate unit testing code for this file.` - `Open a follow-up GitHub issue for this discussion.` - Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples: - `@coderabbitai generate unit testing code for this file.` - `@coderabbitai modularize this function.` - PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples: - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.` - `@coderabbitai read src/utils.ts and generate unit testing code.` - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.` - `@coderabbitai help me debug CodeRabbit configuration file.` Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. ### CodeRabbit Commands (Invoked using PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai full review` to do a full review from scratch and review all the files again. - `@coderabbitai summary` to regenerate the summary of the PR. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository. - `@coderabbitai help` to get help. ### Other keywords and placeholders - Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. - Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description. - Add `@coderabbitai` anywhere in the PR title to generate the title automatically. ### CodeRabbit Configuration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information. - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json` ### Documentation and Community - Visit our [Documentation](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit. - Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.