Use a fork of https://github.com/lstrojny/json-schema-to-zod to generate the boundary check for the config automatically.
5 lines
284 B
TypeScript
5 lines
284 B
TypeScript
import { z } from 'zod'
|
|
import { ConfigBoundary as ConfigBoundaryWithoutPlatform } from '../generated/config_boundary'
|
|
|
|
export const ConfigBoundary = z.intersection(ConfigBoundaryWithoutPlatform, z.object({ platform: z.string() }))
|
|
export type Config = z.infer<typeof ConfigBoundary>
|