8000 docs: show only the .properties() method form in the 4.6 post · colinhacks/zod@75d63ee · GitHub
[go: up one dir, main page]

Skip to content

Commit 75d63ee

Browse files
committed
docs: show only the .properties() method form in the 4.6 post
1 parent 46da957 commit 75d63ee

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

‎packages/docs/content/blog/zod-4-6.mdx‎

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Zod 4.6
33
author: Colin McDonnell
44
date: 2026-09-09
5-
description: Zod 4.6 is now available, with .validate() for boolean validation, z.properties() as a real schema, and six more JSON Schema keywords.
5+
description: Zod 4.6 is now available, with .validate() for boolean validation, .properties() on z.instanceof(), and six more JSON Schema keywords.
66
---
77

88
import { ThemedImage } from "@/components/themed-image";
@@ -76,16 +76,7 @@ Both charts measure the failure path. The key feature of `.validate()` is that i
7676
7777
## `z.properties()`
7878

79-
A new API for validating specific properties of an object. Unlike `z.object()` it validates *in-place*, so it plays nice with class instances. ([#6536](https://github.com/colinhacks/zod/pull/6536))
80-
81-
```ts
82-
const responseLike = z.properties({ status: z.number().min(200).max(299) });
83-
84-
responseLike.parse(new Response("ok", { status: 200 })); // ✅ a real Response
85-
responseLike.parse({ status: 204 }); // ✅ a plain object
86-
```
87-
88-
A corresponding `.properties()` method has been added to `ZodInstanceOf`.
79+
A new `.properties()` method on `z.instanceof()` validates specific properties of an instance. Unlike `z.object()` it validates *in-place*, so it plays nice with class instances. ([#6536](https://github.com/colinhacks/zod/pull/6536))
8980

9081
<Tabs groupId="lib" items={["Zod", "Zod Mini"]}>
9182
<Tab value="Zod">

0 commit comments

Comments
 (0)
0