Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency zod to v3.23.8 #1154

Merged
merged 1 commit into from
Sep 26, 2024
Merged

Update dependency zod to v3.23.8 #1154

merged 1 commit into from
Sep 26, 2024

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Apr 23, 2024

This PR contains the following updates:

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

Release Notes

colinhacks/zod (zod)

v3.23.8

Compare Source

Commits:

v3.23.7

Compare Source

v3.23.6

Compare Source

v3.23.5

Compare Source

v3.23.4

Compare Source

Commits:

v3.23.3

Compare Source

v3.23.2

Compare Source

Commits:

v3.23.1

Compare Source

v3.23.0

Compare Source

Zod 3.23 is now available. This is the final 3.x release before Zod 4.0. To try it out:

npm install zod

Features

z.string().date()

Zod can now validate ISO 8601 date strings. Thanks @​igalklebanov! https://github.com/colinhacks/zod/pull/1766

const schema = z.string().date();
schema.parse("2022-01-01"); // OK
z.string().time()

Zod can now validate ISO 8601 time strings. Thanks @​igalklebanov! https://github.com/colinhacks/zod/pull/1766

const schema = z.string().time();
schema.parse("12:00:00"); // OK

You can specify sub-second precision using the precision option:

const schema = z.string().time({ precision: 3 });
schema.parse("12:00:00.123"); // OK
schema.parse("12:00:00.123456"); // Error
schema.parse("12:00:00"); // Error
z.string().duration()

Zod can now validate ISO 8601 duration strings. Thanks @​mastermatt! https://github.com/colinhacks/zod/pull/3265

const schema = z.string().duration();
schema.parse("P3Y6M4DT12H30M5S"); // OK
Improvements to z.string().datetime()

Thanks @​bchrobot https://github.com/colinhacks/zod/pull/2522

You can now allow unqualified (timezone-less) datetimes using the local: true flag.

const schema = z.string().datetime({ local: true });
schema.parse("2022-01-01T12:00:00"); // OK

Plus, Zod now validates the day-of-month correctly to ensure no invalid dates (e.g. February 30th) pass validation. Thanks @​szamanr! https://github.com/colinhacks/zod/pull/3391

z.string().base64()

Zod can now validate base64 strings. Thanks @​StefanTerdell! https://github.com/colinhacks/zod/pull/3047

const schema = z.string().base64();
schema.parse("SGVsbG8gV29ybGQ="); // OK
Improved discriminated unions

The following can now be used as discriminator keys in z.discriminatedUnion():

  • ZodOptional
  • ZodNullable
  • ZodReadonly
  • ZodBranded
  • ZodCatch
const schema = z.discriminatedUnion("type", [
  z.object({ type: z.literal("A").optional(), value: z.number() }),
  z.object({ type: z.literal("B").nullable(), value: z.string() }),
  z.object({ type: z.literal("C").readonly(), value: z.boolean() }),
  z.object({ type: z.literal("D").brand<"D">(), value: z.boolean() }),
  z.object({ type: z.literal("E").catch("E"), value: z.unknown() }),
]);
Misc

Breaking changes

There are no breaking changes to the public API of Zod. However some changes can impact ecosystem tools that rely on Zod internals.

ZodFirstPartySchemaTypes

Three new types have been added to the ZodFirstPartySchemaTypes union. This may impact some codegen libraries. https://github.com/colinhacks/zod/pull/3247

+  | ZodPipeline<any, any>
+  | ZodReadonly<any>
+  | ZodSymbol;
Default generics in ZodType

The third argument of the ZodType base class now defaults to unknown. This makes it easier to define recursive schemas and write generic functions that accept Zod schemas.

- class ZodType<Output = any, Def extends ZodTypeDef = ZodTypeDef, Input = Output> {}
+ class ZodType<Output = unknown, Def extends ZodTypeDef = ZodTypeDef, Input = unknown> {}
Unrecognized keys in .pick() and .omit()

This version fixes a bug where unknown keys were accidentally accepted in .pick() and omit(). This has been fixed, which could cause compiler errors in some user code. https://github.com/colinhacks/zod/pull/3255

z.object({ 
  name: z.string() 
}).pick({
  notAKey: true // no longer allowed
})

Bugfixes and performance

Docs and ecosystem

New Contributors

Full Changelog: colinhacks/zod@v3.22.4...v3.23.0

v3.22.5

Compare Source


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

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.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot enabled auto-merge (rebase) April 23, 2024 20:03
@renovate renovate bot force-pushed the renovate/zod-3.x branch 4 times, most recently from 3bf2f08 to 6879c1f Compare April 29, 2024 21:28
@renovate renovate bot changed the title fix(deps): update dependency zod to v3.23.4 fix(deps): update dependency zod to v3.23.5 Apr 29, 2024
@renovate renovate bot force-pushed the renovate/zod-3.x branch 2 times, most recently from 583fbdc to 6718234 Compare May 3, 2024 04:25
@renovate renovate bot changed the title fix(deps): update dependency zod to v3.23.5 fix(deps): update dependency zod to v3.23.6 May 3, 2024
@renovate renovate bot force-pushed the renovate/zod-3.x branch 3 times, most recently from 72688f1 to dc3d89d Compare May 7, 2024 23:04
@renovate renovate bot changed the title fix(deps): update dependency zod to v3.23.6 fix(deps): update dependency zod to v3.23.7 May 7, 2024
@renovate renovate bot force-pushed the renovate/zod-3.x branch from dc3d89d to e39a691 Compare May 8, 2024 23:12
@renovate renovate bot changed the title fix(deps): update dependency zod to v3.23.7 fix(deps): update dependency zod to v3.23.8 May 8, 2024
@renovate renovate bot force-pushed the renovate/zod-3.x branch 3 times, most recently from 08d2dc6 to ce22231 Compare May 15, 2024 14:34
@renovate renovate bot force-pushed the renovate/zod-3.x branch from ce22231 to 7f9c7da Compare June 2, 2024 20:10
@renovate renovate bot force-pushed the renovate/zod-3.x branch from 7f9c7da to 5d4c16a Compare June 10, 2024 06:56
@renovate renovate bot changed the title fix(deps): update dependency zod to v3.23.8 Update dependency zod to v3.23.8 Jun 10, 2024
@renovate renovate bot force-pushed the renovate/zod-3.x branch from 5d4c16a to 7e247d1 Compare July 28, 2024 19:40
@renovate renovate bot force-pushed the renovate/zod-3.x branch from 7e247d1 to 27fadae Compare September 25, 2024 21:28
Copy link

codecov bot commented Sep 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.10%. Comparing base (ca1048e) to head (cd335df).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1154   +/-   ##
=======================================
  Coverage   86.10%   86.10%           
=======================================
  Files          29       29           
  Lines        1439     1439           
  Branches      342      342           
=======================================
  Hits         1239     1239           
  Misses        189      189           
  Partials       11       11           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@renovate renovate bot force-pushed the renovate/zod-3.x branch 6 times, most recently from 83191f0 to 54af9df Compare September 26, 2024 06:17
@renovate renovate bot force-pushed the renovate/zod-3.x branch from 54af9df to cd335df Compare September 26, 2024 06:19
@renovate renovate bot merged commit 2c015de into main Sep 26, 2024
4 checks passed
@renovate renovate bot deleted the renovate/zod-3.x branch September 26, 2024 06:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants