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

Commit c22944b

Browse filesBrowse files
committed
Fix race condition
1 parent 91274c3 commit c22944b
Copy full SHA for c22944b

File tree

Expand file treeCollapse file tree

2 files changed

+21
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+21
-3
lines changed
Open diff view settings
Collapse file

‎packages/zod/src/v4/classic/tests/readonly.test.ts‎

Copy file name to clipboardExpand all lines: packages/zod/src/v4/classic/tests/readonly.test.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ test("readonly and the get method", () => {
240240
expect(readonlyBigInt.parse(bigIntVal)).toEqual(bigIntVal);
241241
expect(readonlyBoolean.parse(true)).toEqual(true);
242242
const dateVal = new Date();
243-
expect(readonlyDate.parse(new Date())).toEqual(dateVal);
243+
expect(readonlyDate.parse(dateVal)).toEqual(dateVal);
244244
expect(readonlyUndefined.parse(undefined)).toEqual(undefined);
245245
expect(readonlyNull.parse(null)).toEqual(null);
246246
expect(readonlyAny.parse("whatever")).toEqual("whatever");
Collapse file

‎play.ts‎

Copy file name to clipboard
+20-2Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
import { z } from "zod/v4";
22

3-
z.string().regex(/asdf/);
3+
// import { z } from "zod/v4";
44

5-
z.literal;
5+
export const elementInputSchema = z
6+
.discriminatedUnion("type", [
7+
z.object({
8+
type: z.literal("CONTAINER"),
9+
}),
10+
z.object({
11+
type: z.literal("SCREEN"),
12+
config: z.object({ x: z.number(), y: z.number() }),
13+
}),
14+
])
15+
.and(
16+
z.object({
17+
get children(): z.ZodOptional<z.ZodArray<typeof elementInputSchema>> {
18+
return z.array(elementInputSchema).optional();
19+
},
20+
})
21+
);
22+
23+
export type ElementInput = z.infer<typeof elementInputSchema>;

0 commit comments

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