Closed renovate[bot] closed 1 year ago
Latest commit: 9f7b6edc5e16ad5977363041bd493f5f426a2f4e
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
Base: 81.41% // Head: 81.41% // No change to project coverage :thumbsup:
Coverage data is based on head (
9f7b6ed
) compared to base (ba2dca5
). Patch has no changes to coverable lines.
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
This PR contains the following updates:
3.19.1
->3.20.2
⚠ Dependency Lookup Warnings ⚠
Warnings were logged while processing this repo. Please check the Dependency Dashboard for more information.
Release Notes
colinhacks/zod
### [`v3.20.2`](https://togithub.com/colinhacks/zod/releases/tag/v3.20.2) [Compare Source](https://togithub.com/colinhacks/zod/compare/v3.20.1...v3.20.2) #### Commits: - [`d7d49e7`](https://togithub.com/colinhacks/zod/commit/d7d49e77ccd758ee874f7866862840f88f75cbb6) Clarify boolean coercion - [`f49cbcb`](https://togithub.com/colinhacks/zod/commit/f49cbcb38f7e58e37480ded0f8f558c85de1ce3a) Fix formatting - [`0b62f8c`](https://togithub.com/colinhacks/zod/commit/0b62f8c0c1722a15bd8afbc003e78fe7a177b2a2) Revert email regex changes - [`68919aa`](https://togithub.com/colinhacks/zod/commit/68919aa1790fcb729385a4b290ee03b3d8df0d86) 3.20.2 - [`c9e4ed4`](https://togithub.com/colinhacks/zod/commit/c9e4ed4095d77f5b43a5ba11d8f76b56ea48e5c6) Fix string test ### [`v3.20.1`](https://togithub.com/colinhacks/zod/releases/tag/v3.20.1) [Compare Source](https://togithub.com/colinhacks/zod/compare/v3.20.0...v3.20.1) ##### Commits: - [`1298d26`](https://togithub.com/colinhacks/zod/commit/1298d26115e09cf097cb272cfc3184484eb64fd1) Update readme - [`b3b0ecf`](https://togithub.com/colinhacks/zod/commit/b3b0ecfcb8d2314cf3e6cbd78056c5410650c348) Only call .catch() method when parsing fails ([#1674](https://togithub.com/colinhacks/zod/issues/1674)) - [`957b55b`](https://togithub.com/colinhacks/zod/commit/957b55b82d19707888a4914670c8cf8563911425) Fixing ZodString::isDatetime. ([#1678](https://togithub.com/colinhacks/zod/issues/1678)) - [`29ec1f8`](https://togithub.com/colinhacks/zod/commit/29ec1f8d99836d8bb0661cac8641d4b4094aaf40) Add default - [`1161b8f`](https://togithub.com/colinhacks/zod/commit/1161b8f77e8ef120f9a0fca6e1ca223538d8ffc4) 3.20.1 ### [`v3.20.0`](https://togithub.com/colinhacks/zod/releases/tag/v3.20.0): -beta [Compare Source](https://togithub.com/colinhacks/zod/compare/v3.19.1...v3.20.0) ##### 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()`. ```ts z.string() .transform(val => val.length) .pipe(z.number().min(5)) ``` The `.pipe()` method returns a `ZodPipeline` instance. ##### `z.coerce` Zod now provides a more convenient way to coerce primitive values. ```ts const schema = z.coerce.string(); schema.parse("tuna"); // => "tuna" schema.parse(12); // => "12" schema.parse(true); // => "true" ``` 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 a `ZodString` instance so you can use all string methods. ```ts z.coerce.string().email().min(5); ``` All primitive types support coercion. ```ts z.coerce.string(); // String(input) z.coerce.number(); // Number(input) z.coerce.boolean(); // Boolean(input) z.coerce.bigint(); // BigInt(input) z.coerce.date(); // new Date(input) ``` ##### `.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. ```ts const schema = z.string().catch("fallback"); schema.parse("kate"); // => "kate" schema.parse(4); // => "fallback" ``` The `.catch()` method returns a `ZodCatch` instance. ##### `z.symbol()` A long-missing hole in Zod's type system is finally filled! Thanks [@santosmarco-caribou](https://togithub.com/santosmarco-caribou). ```ts const schema = z.symbol(); schema.parse(Symbol('asdf')); ``` Relatedly, you can also pass symbols into `z.literal()`. ```ts const TUNA = Symbol("tuna"); const schema = z.literal(TUNA); schema.parse(TUNA); // Symbol(tuna) schema.parse(Symbol("nottuna")); // Error ``` ##### `z.string().datetime()` A new method has been added to `ZodString` to validate ISO datetime strings. Thanks [@samchungy](https://togithub.com/samchungy)! ```ts z.string().datetime(); ``` 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. ```ts const dt = z.string().datetime(); dt.parse("2020-01-01T00:00:00Z"); // 🟢 dt.parse("2020-01-01T00:00:00.123Z"); // 🟢 dt.parse("2020-01-01T00:00:00.123456Z"); // 🟢 (arbitrary precision) dt.parse("2020-01-01T00:00:00+02:00"); // 🔴 (no offsets allowed) ``` Offsets can be supported with the `offset` parameter. ```ts const a = z.string().datetime({ offset: true }); a.parse("2020-01-01T00:00:00+02:00"); // 🟢 offset allowed ``` You can additionally constrain the allowable `precision`. This specifies the number of digits that should follow the decimal point. ```ts const b = z.string().datetime({ precision: 3 }) b.parse("2020-01-01T00:00:00.123Z"); // 🟢 precision of 3 decimal points b.parse("2020-01-01T00:00:00Z"); // 🔴 invalid precision ``` ##### `z.number().finite()` Restrict a number schema to finite values. Thanks [@igalklebanov](https://togithub.com/igalklebanov). ```ts const schema = z.number().finite(); schema.parse(5); 🟢 schema.parse(Infinity); 🔴 schema.parse(-Infinity); 🔴 ``` ##### What's Changed - Add `mask` parameter to `.required` method by [@SrBrahma](https://togithub.com/SrBrahma) in [https://github.com/colinhacks/zod/pull/1315](https://togithub.com/colinhacks/zod/pull/1315) - Added Intersections to TOC by [@tmkn](https://togithub.com/tmkn) in [https://github.com/colinhacks/zod/pull/1450](https://togithub.com/colinhacks/zod/pull/1450) - \[[#1468](https://togithub.com/colinhacks/zod/issues/1468)] Fix zod.dev main page cross origin links. by [@agrahamg](https://togithub.com/agrahamg) in [https://github.com/colinhacks/zod/pull/1469](https://togithub.com/colinhacks/zod/pull/1469) - Updates remix-domains library name and description in README by [@diogob](https://togithub.com/diogob) in [https://github.com/colinhacks/zod/pull/1501](https://togithub.com/colinhacks/zod/pull/1501) - Removed BRAND from ZodBrand Input definition by [@Xetera](https://togithub.com/Xetera) in [https://github.com/colinhacks/zod/pull/1492](https://togithub.com/colinhacks/zod/pull/1492) - Add Zodix to readme ecosystem section by [@rileytomasek](https://togithub.com/rileytomasek) in [https://github.com/colinhacks/zod/pull/1506](https://togithub.com/colinhacks/zod/pull/1506) - Fix small typos in README by [@Yhozen](https://togithub.com/Yhozen) in [https://github.com/colinhacks/zod/pull/1521](https://togithub.com/colinhacks/zod/pull/1521) - fix typo by [@oasido](https://togithub.com/oasido) in [https://github.com/colinhacks/zod/pull/1528](https://togithub.com/colinhacks/zod/pull/1528) - add `fatal` to `ZodIssue`. by [@igalklebanov](https://togithub.com/igalklebanov) in [https://github.com/colinhacks/zod/pull/1555](https://togithub.com/colinhacks/zod/pull/1555) - Fix typo in ERROR_HANDLING.md by [@Tsuyoshi84](https://togithub.com/Tsuyoshi84) in [https://github.com/colinhacks/zod/pull/1543](https://togithub.com/colinhacks/zod/pull/1543) - add `.finite()` @ `ZodNumber`. by [@igalklebanov](https://togithub.com/igalklebanov) in [https://github.com/colinhacks/zod/pull/1546](https://togithub.com/colinhacks/zod/pull/1546) - Fix typing bug hiding errors of nullable composite fields by [@tadeokondrak](https://togithub.com/tadeokondrak) in [https://github.com/colinhacks/zod/pull/1545](https://togithub.com/colinhacks/zod/pull/1545) - [#1227](https://togithub.com/colinhacks/zod/issues/1227) Feature default on mismatch by [@seancrowe](https://togithub.com/seancrowe) in [https://github.com/colinhacks/zod/pull/1537](https://togithub.com/colinhacks/zod/pull/1537) - fix [#1046](https://togithub.com/colinhacks/zod/issues/1046) `.required()` doesn't remove optional flag from the result of `.nullish()`. by [@igalklebanov](https://togithub.com/igalklebanov) in [https://github.com/colinhacks/zod/pull/1542](https://togithub.com/colinhacks/zod/pull/1542) - add `datetime()` string formats by [@samchungy](https://togithub.com/samchungy) in [https://github.com/colinhacks/zod/pull/1494](https://togithub.com/colinhacks/zod/pull/1494) - Bump minimatch from 3.0.4 to 3.1.2 by [@dependabot](https://togithub.com/dependabot) in [https://github.com/colinhacks/zod/pull/1558](https://togithub.com/colinhacks/zod/pull/1558) - Bump minimist from 1.2.5 to 1.2.7 by [@dependabot](https://togithub.com/dependabot) in [https://github.com/colinhacks/zod/pull/1507](https://togithub.com/colinhacks/zod/pull/1507) - [#1171](https://togithub.com/colinhacks/zod/issues/1171) support for refine, superRefine, transform and lazy in discriminatedUnion by [@roblabat](https://togithub.com/roblabat) in [https://github.com/colinhacks/zod/pull/1290](https://togithub.com/colinhacks/zod/pull/1290) - branded type as normal argument by [@KATT](https://togithub.com/KATT) in [https://github.com/colinhacks/zod/pull/1502](https://togithub.com/colinhacks/zod/pull/1502) - Take `path` parameter into account within `.parseAsync()` by [@RobinTail](https://togithub.com/RobinTail) in [https://github.com/colinhacks/zod/pull/1513](https://togithub.com/colinhacks/zod/pull/1513) - Update README.md by [@rosnerdev](https://togithub.com/rosnerdev) in [https://github.com/colinhacks/zod/pull/1463](https://togithub.com/colinhacks/zod/pull/1463) - Add `ZodSymbol` by [@santosmarco-caribou](https://togithub.com/santosmarco-caribou) in [https://github.com/colinhacks/zod/pull/1448](https://togithub.com/colinhacks/zod/pull/1448) - Fix Minor Typos by [@WebDevSimplified](https://togithub.com/WebDevSimplified) in [https://github.com/colinhacks/zod/pull/1624](https://togithub.com/colinhacks/zod/pull/1624) ##### New Contributors - [@SrBrahma](https://togithub.com/SrBrahma) made their first contribution in [https://github.com/colinhacks/zod/pull/1315](https://togithub.com/colinhacks/zod/pull/1315) - [@tmkn](https://togithub.com/tmkn) made their first contribution in [https://github.com/colinhacks/zod/pull/1450](https://togithub.com/colinhacks/zod/pull/1450) - [@agrahamg](https://togithub.com/agrahamg) made their first contribution in [https://github.com/colinhacks/zod/pull/1469](https://togithub.com/colinhacks/zod/pull/1469) - [@diogob](https://togithub.com/diogob) made their first contribution in [https://github.com/colinhacks/zod/pull/1501](https://togithub.com/colinhacks/zod/pull/1501) - [@Xetera](https://togithub.com/Xetera) made their first contribution in [https://github.com/colinhacks/zod/pull/1492](https://togithub.com/colinhacks/zod/pull/1492) - [@rileytomasek](https://togithub.com/rileytomasek) made their first contribution in [https://github.com/colinhacks/zod/pull/1506](https://togithub.com/colinhacks/zod/pull/1506) - [@Yhozen](https://togithub.com/Yhozen) made their first contribution in [https://github.com/colinhacks/zod/pull/1521](https://togithub.com/colinhacks/zod/pull/1521) - [@oasido](https://togithub.com/oasido) made their first contribution in [https://github.com/colinhacks/zod/pull/1528](https://togithub.com/colinhacks/zod/pull/1528) - [@igalklebanov](https://togithub.com/igalklebanov) made their first contribution in [https://github.com/colinhacks/zod/pull/1555](https://togithub.com/colinhacks/zod/pull/1555) - [@Tsuyoshi84](https://togithub.com/Tsuyoshi84) made their first contribution in [https://github.com/colinhacks/zod/pull/1543](https://togithub.com/colinhacks/zod/pull/1543) - [@tadeokondrak](https://togithub.com/tadeokondrak) made their first contribution in [https://github.com/colinhacks/zod/pull/1545](https://togithub.com/colinhacks/zod/pull/1545) - [@seancrowe](https://togithub.com/seancrowe) made their first contribution in [https://github.com/colinhacks/zod/pull/1537](https://togithub.com/colinhacks/zod/pull/1537) - [@samchungy](https://togithub.com/samchungy) made their first contribution in [https://github.com/colinhacks/zod/pull/1494](https://togithub.com/colinhacks/zod/pull/1494) - [@roblabat](https://togithub.com/roblabat) made their first contribution in [https://github.com/colinhacks/zod/pull/1290](https://togithub.com/colinhacks/zod/pull/1290) - [@KATT](https://togithub.com/KATT) made their first contribution in [https://github.com/colinhacks/zod/pull/1502](https://togithub.com/colinhacks/zod/pull/1502) - [@RobinTail](https://togithub.com/RobinTail) made their first contribution in [https://github.com/colinhacks/zod/pull/1513](https://togithub.com/colinhacks/zod/pull/1513) - [@rosnerdev](https://togithub.com/rosnerdev) made their first contribution in [https://github.com/colinhacks/zod/pull/1463](https://togithub.com/colinhacks/zod/pull/1463) - [@santosmarco-caribou](https://togithub.com/santosmarco-caribou) made their first contribution in [https://github.com/colinhacks/zod/pull/1448](https://togithub.com/colinhacks/zod/pull/1448) - [@WebDevSimplified](https://togithub.com/WebDevSimplified) made their first contribution in [https://github.com/colinhacks/zod/pull/1624](https://togithub.com/colinhacks/zod/pull/1624) **Full Changelog**: https://github.com/colinhacks/zod/compare/v3.19.1...v3.20.0Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), 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 has been generated by Mend Renovate. View repository job log here.