refactor: Migrate config schema from Zod v3 to Zod v4 (#2357)

This commit is contained in:
Dermot Duffy
2026-02-18 21:47:43 -08:00
committed by GitHub
parent a15376602f
commit 529500ed94
51 changed files with 1110 additions and 443 deletions
+7 -6
View File
@@ -60,14 +60,15 @@ const titleMatcherSchema = z.object({
});
export type TitleMatcher = z.infer<typeof titleMatcherSchema>;
type OrMatcher = {
type: 'or';
matchers: Matcher[];
};
const orMatcherSchema: z.ZodSchema<OrMatcher, z.ZodTypeDef> = z.object({
const orMatcherSchema = z.object({
type: z.literal('or'),
matchers: z.array(z.lazy(() => matcherSchema)),
get matchers() {
// Recursive schema.
return z.array(matcherSchema);
},
});
export const matcherSchema = z.union([
dateMatcherSchema,
orMatcherSchema,