diff options
Diffstat (limited to 'Homework/cs5260/shared/schema/Widget.ts')
| -rw-r--r-- | Homework/cs5260/shared/schema/Widget.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Homework/cs5260/shared/schema/Widget.ts b/Homework/cs5260/shared/schema/Widget.ts new file mode 100644 index 0000000..e7f09d1 --- /dev/null +++ b/Homework/cs5260/shared/schema/Widget.ts @@ -0,0 +1,13 @@ +import { z } from "zod"; + +export const Widget = z.object({ + id: z.string(), + owner: z.string().regex(new RegExp("[A-Za-z ]+")), + label: z.string().optional(), + description: z.string().optional(), + otherAttributes: z + .array(z.object({ name: z.string(), value: z.string() })) + .optional(), +}); + +export type WidgetT = z.infer<typeof Widget>; |
