(schema: T)
| 29 | type SimulatorSelector = { simulatorId?: unknown; simulatorName?: unknown }; |
| 30 | |
| 31 | export function withSimulatorIdOrName<T extends z.ZodType<SimulatorSelector>>(schema: T) { |
| 32 | return schema |
| 33 | .refine((val) => val.simulatorId !== undefined || val.simulatorName !== undefined, { |
| 34 | message: 'Either simulatorId or simulatorName is required.', |
| 35 | }) |
| 36 | .refine((val) => !(val.simulatorId !== undefined && val.simulatorName !== undefined), { |
| 37 | message: 'simulatorId and simulatorName are mutually exclusive. Provide only one.', |
| 38 | }); |
| 39 | } |
no outgoing calls
no test coverage detected