71
base = z.union(literals.map(v => z.literal(v as Exclude<typeof literals[number], null>)) as unknown as [ZodTypeAny, ZodTypeAny, ...ZodTypeAny[]]);
72
}
74
base = unionOf(prop.oneOf);
76
base = unionOf(prop.anyOf);
78
>
const type = Array.isArray(prop.type) ? prop.type[0] : prop.type;
79
>
switch (type) {
80
>
case 'string':
81
base = z.string();
82
break;
84
base = z.number();
85
break;
87
base = z.number().int();
88
break;
90
base = z.boolean();
91
break;
93
base = z.array(prop.items ? jsonPropertyToZod(prop.items) : z.any());
94
break;
96
const sub: Record<string, ZodTypeAny> = {};
97
const subRequired = new Set(prop.required ?? []);