Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(deps): update dependency zod to ^3.21.0 (#111)
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [zod](https://zod.dev) ([source](https://github.com/colinhacks/zod)) | [`^3.20.6` -> `^3.21.0`](https://renovatebot.com/diffs/npm/zod/3.20.6/3.21.0) | [![age](https://badges.renovateapi.com/packages/npm/zod/3.21.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/zod/3.21.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/zod/3.21.0/compatibility-slim/3.20.6)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/zod/3.21.0/confidence-slim/3.20.6)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>colinhacks/zod</summary> ### [`v3.21.0`](https://github.com/colinhacks/zod/releases/tag/v3.21.0) [Compare Source](https://github.com/colinhacks/zod/compare/v3.20.6...v3.21.0) #### Features ##### `z.string().emoji()` Thanks [@​joseph-lozano](https://github.com/joseph-lozano) for [https://github.com/colinhacks/zod/pull/2045](https://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://github.com/joulev) for [https://github.com/colinhacks/zod/pull/1813](https://github.com/colinhacks/zod/pull/1813)! To validate [CUIDv2](https://github.com/paralleldrive/cuid2): ```ts z.string().cuid2() ``` ##### `z.string().ip()` Thanks [@​fvckDesa](https://github.com/fvckDesa) for [https://github.com/colinhacks/zod/pull/2066](https://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://github.com/igalklebanov) for [`#1711`](https://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://github.com/santosmarco-caribou) for [https://github.com/colinhacks/zod/pull/1652](https://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://github.com/0xWryth) for [https://github.com/colinhacks/zod/pull/2087](https://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://github.com/gydroperit) for some heroic efforts here: [https://github.com/colinhacks/zod/pull/2107](https://github.com/colinhacks/zod/pull/2107) Zod 3.21 resolves these issues: - [https://github.com/colinhacks/zod/issues/2142](https://github.com/colinhacks/zod/issues/2142) - [https://github.com/colinhacks/zod/issues/1741](https://github.com/colinhacks/zod/issues/1741) - https://stackoverflow.com/questions/74881472/slow-typescript-autocompletion-in-vs-code-for-zod #### Commits: - [`3c54461`](https://github.com/colinhacks/zod/commit/3c54461d7a649bf727aec59367eefb214ffe24fe) fix typo in readme - [`c244fb6`](https://github.com/colinhacks/zod/commit/c244fb6c57506fd11609106960639de26ddf9b6d) feat: z.string().emoji() ([#​2045](https://github.com/colinhacks/zod/issues/2045)) - [`39cbb69`](https://github.com/colinhacks/zod/commit/39cbb6971c3dca09cbc0acdca2d3995dfd26aab2) Fix emoji validation, fix lint - [`d8f07bb`](https://github.com/colinhacks/zod/commit/d8f07bbfffd255b0aee6b5fe9bb6aa2bce6586af) Fix emoji - [`9b7dd81`](https://github.com/colinhacks/zod/commit/9b7dd816e92e16ca735e488b77e280a92a84ed64) Improve variable name clarity ([#​2048](https://github.com/colinhacks/zod/issues/2048)) - [`5cec187`](https://github.com/colinhacks/zod/commit/5cec1871ac21627608af6c07585d5e50ff30f281) Add documentation for the param parameter of z.custom - [`654f529`](https://github.com/colinhacks/zod/commit/654f52969a968c630af816dcad0d8f3721f9001a) Merge pull request [#​2057](https://github.com/colinhacks/zod/issues/2057) from trygveaa/add-documentation-for-z-custom-params - [`981af65`](https://github.com/colinhacks/zod/commit/981af6503ee1be530fe525ac77ba95e1904ce24a) Merge pull request [#​2019](https://github.com/colinhacks/zod/issues/2019) from vbud/patch-1 - [`a7c2969`](https://github.com/colinhacks/zod/commit/a7c2969b9125df0fbfa65e8541a974eeaf53b6a6) Update error_handling - [`8f3d028`](https://github.com/colinhacks/zod/commit/8f3d0283ba75d146d5199fe3dc140eeb5402352c) BRAND Record to Non Partial ([#​2097](https://github.com/colinhacks/zod/issues/2097)) - [`5ec98e1`](https://github.com/colinhacks/zod/commit/5ec98e1c4420957f93a7388bf49fb01d91bcbcd0) Fix email issues in pull request [#​1982](https://github.com/colinhacks/zod/issues/1982) ([#​2058](https://github.com/colinhacks/zod/issues/2058)) - [`7d40ba5`](https://github.com/colinhacks/zod/commit/7d40ba58931130ec965be9d65d14e0665ee9c379) feat([#​2059](https://github.com/colinhacks/zod/issues/2059)): z.string.ip() - add support for IP address ([#​2066](https://github.com/colinhacks/zod/issues/2066)) - [`e559605`](https://github.com/colinhacks/zod/commit/e5596054cfddf8aa1ba8d7d3bad63552a2bf9b6a) feat: add `.catch` error ([#​2087](https://github.com/colinhacks/zod/issues/2087)) - [`defdab9`](https://github.com/colinhacks/zod/commit/defdab9c163d9a994f927a0644ab4ec172513fcb) Fix record tests - [`8de36eb`](https://github.com/colinhacks/zod/commit/8de36eb17d9477ada75cea2164d6b47079dd0444) FIX: emoji regex and tests ([#​2090](https://github.com/colinhacks/zod/issues/2090)) - [`16beeb5`](https://github.com/colinhacks/zod/commit/16beeb598039b33bc5a209956042d858abacca34) lowercase method for ZodString ([#​2038](https://github.com/colinhacks/zod/issues/2038)) - [`75cb9e8`](https://github.com/colinhacks/zod/commit/75cb9e814115a35c0b4cc2e970f6aaae90e1a13c) add checks @​ `ZodBigInt`. ([#​1711](https://github.com/colinhacks/zod/issues/1711)) - [`c4d4e49`](https://github.com/colinhacks/zod/commit/c4d4e494227aadc752d4d5a5a317ec16bb6f5a45) Update ERROR_HANDLING.md ([#​2022](https://github.com/colinhacks/zod/issues/2022)) - [`d6f0890`](https://github.com/colinhacks/zod/commit/d6f08908b17ea10456befc2231a867d5cea02a0e) added link to deno land - [`4cf1960`](https://github.com/colinhacks/zod/commit/4cf19606870e66bf4307984bf99a4bef495c7818) Refactoring of ZodFormattedError type to improve tsc check time ([#​2107](https://github.com/colinhacks/zod/issues/2107)) - [`867a921`](https://github.com/colinhacks/zod/commit/867a921a93160780d9f3aeddabf1ca49758a3c1e) Bump http-cache-semantics from 4.1.0 to 4.1.1 ([#​1985](https://github.com/colinhacks/zod/issues/1985)) - [`edc3a67`](https://github.com/colinhacks/zod/commit/edc3a67e77d33979b3ee9e071557b4ca53298c55) Deprecate deepPartial - [`e59f639`](https://github.com/colinhacks/zod/commit/e59f639d3bb5cca65ef239d5dd5c93e74ce4a801) Add custom tests - [`a6b44ed`](https://github.com/colinhacks/zod/commit/a6b44ed8e346af2fabbb62b5164b99a387accd32) Remove logging - [`a1fc3fb`](https://github.com/colinhacks/zod/commit/a1fc3fb815051beb4b7030969828aa6abe469c2c) commented out `toLowerCase` and `toUpperCase` - [`e71cc52`](https://github.com/colinhacks/zod/commit/e71cc523b1865568c4db45f82789e5c86bed0f12) Update README_ZH.md ([#​2139](https://github.com/colinhacks/zod/issues/2139)) - [`3af38fb`](https://github.com/colinhacks/zod/commit/3af38fbe2cb114219e688103e41e382e28ec7a80) add `ZodNumber.safe()` & `ZodNumber.isSafe`. ([#​1753](https://github.com/colinhacks/zod/issues/1753)) - [`6ef82ee`](https://github.com/colinhacks/zod/commit/6ef82ee1e45dbcfc92a2ed359b1d2ae87d54c43d) Add benchmark flags - [`5463593`](https://github.com/colinhacks/zod/commit/5463593385549452768e060a98cc0fd8988760d2) Support brands in recursive types - [`8074523`](https://github.com/colinhacks/zod/commit/80745238937adc06c5b4eab19ef273ca9f7f2de8) Update readme - [`b6794a4`](https://github.com/colinhacks/zod/commit/b6794a4981b8621fee84642f5313464f5e8f9a22) Add index signature for passthrough - [`3c6cdd2`](https://github.com/colinhacks/zod/commit/3c6cdd245ab73d7ca1461a18b5be2da07abe6b6b) Make generic optional in objectOutputType - [`bc43ad1`](https://github.com/colinhacks/zod/commit/bc43ad18e64cf7add23e90bc6b07d5bba8370e5e) Fix rollup build - [`6a0545a`](https://github.com/colinhacks/zod/commit/6a0545acd5b9cfc40b0b3f04e64bfc5dd789d1b1) 3.21.0 - [`7c07339`](https://github.com/colinhacks/zod/commit/7c0733968d64c7d7aebc1ae54ca90aadcb2bffc3) Fix brand - [`0aa6021`](https://github.com/colinhacks/zod/commit/0aa6021ef3628bb39715bdda416be2c6a4951141) Clean up tests </details> --- ### 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. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/fiatconnect/api-starter). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4xNTcuMSIsInVwZGF0ZWRJblZlciI6IjM0LjE1Ny4xIn0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
- Loading branch information