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

fix(deps): update dependency zod to v3.24.1 #310

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Apr 25, 2024

This PR contains the following updates:

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

Release Notes

colinhacks/zod (zod)

v3.24.1

Compare Source

Commits:

v3.24.0

Compare Source

Implement @standard-schema/spec

This is the first version of Zod to implement the Standard Schema spec. This is a new community effort among several validation library authors to implement a common interface, with the goal of simplifying the process of integrating schema validators with the rest of the ecosystem. Read more about the project and goals here.

z.string().jwt()

Thanks to @​Mokshit06 and @​Cognition-Labs for this contribution!

To verify that a string is a valid 3-part JWT.

z.string().jwt();

⚠️ This does not verify your JWT cryptographically! It merely ensures its in the proper format. Use a library like jsonwebtoken to verify the JWT signature, parse the token, and read the claims.

To constrain the JWT to a specific algorithm:

z.string().jwt({ alg: "RS256" });

z.string().base64url()

Thank you to @​marvinruder!

To complement the JWT validation, Zod 3.24 implements a standalone .base64url() string validation API. (The three elements of JWTs are base64url-encoded JSON strings.)

z.string().base64url()

This functionality is available along the standard z.string().base64() validator added in Zod 3.23.

z.string().cidr()

Thanks to @​wataryooou for their work on this!

A validator for CIDR notation for specifying IP address ranges, e.g. 192.24.12.0/22.

z.string().cidr()

To specify an IP version:

z.string().cidr({ version: "v4" })
z.string().cidr({ version: "v6" })

View the full diff from 3.23.8: colinhacks/zod@v3.23.8...v3.24.0

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 - "after 1am and before 4am" (UTC).

🚦 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 added the deps label Apr 25, 2024
@renovate renovate bot changed the title fix(deps): update dependency zod to v3.22.5 fix(deps): update dependency zod to v3.23.0 Apr 28, 2024
@renovate renovate bot force-pushed the renovate/zod-3.x-lockfile branch from 00defbe to 47c73e2 Compare April 30, 2024 00:03
@renovate renovate bot changed the title fix(deps): update dependency zod to v3.23.0 fix(deps): update dependency zod to v3.23.3 Apr 30, 2024
@renovate renovate bot force-pushed the renovate/zod-3.x-lockfile branch from 47c73e2 to 8d3b01c Compare April 30, 2024 03:07
@renovate renovate bot changed the title fix(deps): update dependency zod to v3.23.3 fix(deps): update dependency zod to v3.23.4 Apr 30, 2024
@renovate renovate bot changed the title fix(deps): update dependency zod to v3.23.4 fix(deps): update dependency zod to v3.23.5 May 6, 2024
@renovate renovate bot force-pushed the renovate/zod-3.x-lockfile branch 2 times, most recently from b890105 to 04a42fe Compare May 9, 2024 02:13
@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 10, 2024
@renovate renovate bot force-pushed the renovate/zod-3.x-lockfile branch from 04a42fe to c0e473a Compare May 14, 2024 02:16
@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 14, 2024
@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 16, 2024
@renovate renovate bot force-pushed the renovate/zod-3.x-lockfile branch 3 times, most recently from 8e5c289 to cbc772d Compare May 24, 2024 01:38
@renovate renovate bot force-pushed the renovate/zod-3.x-lockfile branch 2 times, most recently from bbd7757 to f209e8a Compare June 4, 2024 01:00
@renovate renovate bot force-pushed the renovate/zod-3.x-lockfile branch 6 times, most recently from 50cdd6d to 49eebd8 Compare June 13, 2024 02:13
@renovate renovate bot force-pushed the renovate/zod-3.x-lockfile branch 3 times, most recently from d72bbd8 to 23af295 Compare June 20, 2024 01:53
@renovate renovate bot force-pushed the renovate/zod-3.x-lockfile branch 3 times, most recently from 2c48830 to b6cf76b Compare June 27, 2024 01:11
@renovate renovate bot force-pushed the renovate/zod-3.x-lockfile branch from 742c38a to bb61031 Compare October 16, 2024 01:48
@renovate renovate bot force-pushed the renovate/zod-3.x-lockfile branch 4 times, most recently from 7fd3fb4 to fd8578e Compare November 2, 2024 01:25
@renovate renovate bot force-pushed the renovate/zod-3.x-lockfile branch 3 times, most recently from 780e7c0 to c833d99 Compare November 8, 2024 03:04
@renovate renovate bot force-pushed the renovate/zod-3.x-lockfile branch from c833d99 to 12420dc Compare November 12, 2024 01:56
@renovate renovate bot force-pushed the renovate/zod-3.x-lockfile branch 3 times, most recently from 767b687 to 2e27522 Compare November 26, 2024 02:23
@renovate renovate bot force-pushed the renovate/zod-3.x-lockfile branch 5 times, most recently from d333c84 to 17fab79 Compare December 6, 2024 02:21
@renovate renovate bot changed the title fix(deps): update dependency zod to v3.23.8 fix(deps): update dependency zod to v3.23.8 - autoclosed Dec 8, 2024
@renovate renovate bot closed this Dec 8, 2024
@renovate renovate bot deleted the renovate/zod-3.x-lockfile branch December 8, 2024 18:39
@renovate renovate bot changed the title fix(deps): update dependency zod to v3.23.8 - autoclosed fix(deps): update dependency zod to v3.23.8 Dec 8, 2024
@renovate renovate bot reopened this Dec 8, 2024
@renovate renovate bot force-pushed the renovate/zod-3.x-lockfile branch 2 times, most recently from 17fab79 to 6a1e50c Compare December 12, 2024 03:25
@renovate renovate bot changed the title fix(deps): update dependency zod to v3.23.8 fix(deps): update dependency zod to v3.24.0 Dec 17, 2024
@renovate renovate bot changed the title fix(deps): update dependency zod to v3.24.0 fix(deps): update dependency zod to v3.24.1 Dec 18, 2024
@renovate renovate bot force-pushed the renovate/zod-3.x-lockfile branch from 6a1e50c to 905e903 Compare December 19, 2024 02:18
@renovate renovate bot force-pushed the renovate/zod-3.x-lockfile branch from 905e903 to 0bc7652 Compare January 9, 2025 03:17
@renovate renovate bot force-pushed the renovate/zod-3.x-lockfile branch from 0bc7652 to cdf0377 Compare January 15, 2025 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants