( key: string, val: T, schema: ZodSchema<T>, )
| 25 | } |
| 26 | |
| 27 | export function isConfigValueValid<T>( |
| 28 | key: string, |
| 29 | val: T, |
| 30 | schema: ZodSchema<T>, |
| 31 | ): boolean { |
| 32 | const isValid = schema.safeParse(val).success; |
| 33 | if (!isValid) invalid(key, val, undefined); |
| 34 | |
| 35 | return isValid; |
| 36 | } |
| 37 | |
| 38 | export function isConfigValueValidBoolean(key: string, val: boolean): boolean { |
| 39 | return isConfigValueValid(key, val, z.boolean()); |
no test coverage detected