Skip to content

Commit 8c74035

Browse files
committed
3.25.65
1 parent fcb722a commit 8c74035

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

packages/docs/content/api.mdx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -981,6 +981,10 @@ Dog.parse({ name: "Yeller", extraKey: true });
981981

982982
To define a *catchall schema* that will be used to validate any unrecognized keys:
983983

984+
985+
986+
<Tabs groupId="lib" items={["Zod", "Zod Mini"]}>
987+
<Tab value="Zod">
984988
```ts z.object
985989
const DogWithStrings = z.object({
986990
name: z.string(),
@@ -990,6 +994,23 @@ const DogWithStrings = z.object({
990994
DogWithStrings.parse({ name: "Yeller", extraKey: "extraValue" }); //
991995
DogWithStrings.parse({ name: "Yeller", extraKey: 42 }); //
992996
```
997+
</Tab>
998+
<Tab value="Zod Mini">
999+
```ts z.object
1000+
const DogWithStrings = z.catchall(
1001+
z.object({
1002+
name: z.string(),
1003+
age: z.number().optional(),
1004+
}),
1005+
z.string()
1006+
);
1007+
1008+
DogWithStrings.parse({ name: "Yeller", extraKey: "extraValue" }); //
1009+
DogWithStrings.parse({ name: "Yeller", extraKey: 42 }); //
1010+
```
1011+
</Tab>
1012+
</Tabs>
1013+
9931014

9941015
### `.shape`
9951016

packages/zod/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "zod",
3-
"version": "3.25.64",
3+
"version": "3.25.65",
44
"type": "module",
55
"author": "Colin McDonnell <zod@colinhacks.com>",
66
"description": "TypeScript-first schema declaration and validation library with static type inference",

0 commit comments

Comments
 (0)