Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Releases: colinhacks/zod

v4.2.1

16 Dec 02:48

Choose a tag to compare

Commits:

v4.2.0

15 Dec 07:23

Choose a tag to compare

Features

Implement Standard JSON Schema

standard-schema/standard-schema#134

Implement z.fromJSONSchema()

const jsonSchema = {
  type: "object",
  properties: {
    name: { type: "string" },
    age: { type: "number" }
  },
  required: ["name"]
};

const schema = z.fromJSONSchema(jsonSchema);

Implement z.xor()

const schema = z.xor(
  z.object({ type: "user", name: z.string() }),
  z.object({ type: "admin", role: z.string() })
);
// Exactly one of the schemas must match

Implement z.looseRecord()

const schema = z.looseRecord(z.string(), z.number());
// Allows additional properties beyond those defined

Commits:

  • af49c08 Update docs for JSON Schema conversion of z.undefined() (#5504)
  • 767f320 Add .toJSONSchema() method (#5477)
  • e17dcb6 Add z.fromJSONSchema(), z.looseRecord(), z.xor() (#5534)

v4.1.13

24 Nov 02:38

Choose a tag to compare

Commits:

v4.1.12

06 Oct 16:30

Choose a tag to compare

Commits:

v4.1.11

20 Sep 17:16

Choose a tag to compare

Commits:

v4.1.10

20 Sep 16:43

Choose a tag to compare

Commits:

v4.1.9

16 Sep 21:40

Choose a tag to compare

Commits:

v4.1.8

11 Sep 18:01

Choose a tag to compare

Commits:

v4.1.7

11 Sep 05:23

Choose a tag to compare

Commits:

  • 0cca351 Fix variable name inconsistency in coercion documentation (#5188)
  • aa78c27 Add copy/edit buttons
  • 76452d4 Update button txt
  • 937f73c Fix tsconfig issue in bench
  • 976b436 v4.1.6 (#5222)
  • 4309c61 Fix cidrv6 validation - cidrv6 should reject invalid strings with multiple slashes (#5196)
  • ef95a73 feat(locales): Add Lithuanian (lt) locale (#5210)
  • 3803f3f docs: update wrong contents in codeblocks in api.mdx (#5209)
  • 8a47d5c docs: update coerce example in api.mdx (#5207)
  • e87db13 feat(locales): Add Georgian (ka) locale (#5203)
  • c54b123 docs: adds @traversable/zod and @traversable/zod-test to v4 ecosystem (#5194)
  • c27a294 Fix two tiny grammatical errors in the docs. (#5193)
  • 23a2d66 docs: fix broken links in async refinements and transforms references (#5190)
  • 845a230 fix(locales): Add type name translations to Spanish locale (#5187)
  • 27f13d6 Improve regex precision and eliminate duplicates in regexes.ts (#5181)
  • a8a52b3 fix(v4): fix Khmer and Ukrainian locales (#5177)
  • 887e37c Update slugs
  • e1f1948 fix(v4): ensure array defaults are shallow-cloned (#5173)
  • 9f65038 docs(ecosystem): add DRZL; fix Prisma Zod Generator placement (#5215)
  • aa6f0f0 More fixes (#5223)
  • aab3356 4.1.7

v4.1.5

28 Aug 18:37

Choose a tag to compare

Commits:

Morty Proxy This is a proxified and sanitized view of the page, visit original site.