Skip to content

Commit 77c3c9f

Browse files
committed
Export bg.ts
1 parent af44738 commit 77c3c9f

File tree

2 files changed

+1
-49
lines changed

2 files changed

+1
-49
lines changed

packages/zod/src/v4/locales/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
export { default as ar } from "./ar.js";
22
export { default as az } from "./az.js";
33
export { default as be } from "./be.js";
4+
export { default as bg } from "./bg.js";
45
export { default as ca } from "./ca.js";
56
export { default as cs } from "./cs.js";
67
export { default as da } from "./da.js";

play.ts

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,3 @@
11
import * as z from "zod";
22

33
z;
4-
5-
// export const LinesSchema = <T extends z.ZodType<unknown, any>>(schema: T) =>
6-
// z
7-
// .string()
8-
// .transform((input) => input.trim().split("\n"))
9-
// .pipe(z.array(schema));
10-
11-
const AType = z.object({
12-
type: z.literal("a"),
13-
name: z.string(),
14-
});
15-
16-
const BType = z.object({
17-
type: z.literal("b"),
18-
name: z.string(),
19-
});
20-
21-
const CType = z.object({
22-
type: z.literal("c"),
23-
name: z.string(),
24-
});
25-
26-
const Schema = z.object({
27-
type: z.literal("special").meta({ description: "Type" }),
28-
config: z.object({
29-
title: z.string().meta({ description: "Title" }),
30-
get elements() {
31-
return z.array(z.discriminatedUnion("type", [AType, BType, CType])).meta({
32-
id: "SpecialElements",
33-
title: "SpecialElements",
34-
description: "Array of elements",
35-
});
36-
},
37-
}),
38-
});
39-
40-
console.log(
41-
Schema.parse({
42-
type: "special",
43-
config: {
44-
title: "Special",
45-
elements: [
46-
{ type: "a", name: "John" },
47-
{ type: "b", name: "Jane" },
48-
{ type: "c", name: "Jim" },
49-
],
50-
},
51-
})
52-
);

0 commit comments

Comments
 (0)