Skip to content

Commit 2db0dca

Browse files
committed
3.21.3
1 parent c458381 commit 2db0dca

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "zod",
3-
"version": "3.21.2",
3+
"version": "3.21.3",
44
"author": "Colin McDonnell <[email protected]>",
55
"repository": {
66
"type": "git",

Diff for: playground.ts

+16
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,18 @@
11
import { z } from "./src";
22
z;
3+
4+
const baseCategorySchema = z.object({
5+
name: z.string().brand("CategoryName"),
6+
});
7+
8+
type CategoryInput = z.input<typeof baseCategorySchema> & {
9+
subcategories: CategoryInput[];
10+
};
11+
type CategoryOutput = z.output<typeof baseCategorySchema> & {
12+
subcategories: CategoryOutput[];
13+
};
14+
15+
const categorySchema: z.ZodType<CategoryOutput, any, CategoryInput> =
16+
baseCategorySchema.extend({
17+
subcategories: z.lazy(() => categorySchema.array()),
18+
});

0 commit comments

Comments
 (0)