Created
January 8, 2024 13:46
-
-
Save ducva/18e40ce502c349b096b0fc21848f0c48 to your computer and use it in GitHub Desktop.
zod first try
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const ChannelConfigSchema = z.union([ | |
| LineChannelConfigSchema, | |
| MailChannelConfigSchema | |
| ]) | |
| export const ChannelSchema = z.object({ | |
| id: z.string(), | |
| name: z.string(), | |
| type: z.nativeEnum(ChannelType), | |
| config: ChannelConfigSchema | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment