(s: string)
| 57 | .max(50) |
| 58 | .describe("Short title displayed above the chart."), |
| 59 | chart: z |
| 60 | .discriminatedUnion("type", [pieChart, seriesChart]) |
| 61 | .describe("Slack pie, bar, area, or line chart payload."), |
| 62 | }).superRefine(({ chart }, ctx) => { |
| 63 | if (chart.type === "pie") return; |
| 64 | |
| 65 | const categories = chart.axis_config.categories; |
| 66 | if (new Set(categories).size !== categories.length) { |
| 67 | ctx.addIssue({ |
| 68 | code: z.ZodIssueCode.custom, |
| 69 | path: ["chart", "axis_config", "categories"], |