homebridge-prometheus-exporter/src/boundaries/config.ts
Lars Strojny 52efa69bf0
Automate code generation for config schema (#16)
Use a fork of https://github.com/lstrojny/json-schema-to-zod to generate
the boundary check for the config automatically.
2022-11-10 13:06:16 +01:00

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>