Skip to content

Releases: colinhacks/zod

v3.24.1

11 Dec 01:40
Compare
Choose a tag to compare

Commits:

v3.24.0

10 Dec 06:59
Compare
Choose a tag to compare

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: v3.23.8...v3.24.0

v3.23.8

08 May 19:13
Compare
Choose a tag to compare

Commits:

v3.23.7

07 May 20:00
Compare
Choose a tag to compare

Commits:

v3.23.6

03 May 00:59
Compare
Choose a tag to compare

Commits:

v3.23.5

29 Apr 19:41
Compare
Choose a tag to compare

Commits:

v3.23.4

23 Apr 17:35
Compare
Choose a tag to compare

Commits:

v3.23.3

22 Apr 22:49
Compare
Choose a tag to compare

Commits:

v3.23.2

22 Apr 22:37
Compare
Choose a tag to compare

Commits:

v3.23.1

22 Apr 22:17
Compare
Choose a tag to compare

This changes the default generics back to any to prevent breakages with common packager like @hookform/resolvers:

- class ZodType<Output = unknown, Def extends ZodTypeDef = ZodTypeDef, Input = unknown> {}
+ class ZodType<Output = any, Def extends ZodTypeDef = ZodTypeDef, Input = any> {}

Commits: