(key: string)
| 52 | } |
| 53 | |
| 54 | export function optionalBoolean(key: string): ParamCheck { |
| 55 | return (record) => { |
| 56 | const value = record[key] |
| 57 | if (value !== undefined && typeof value !== "boolean") return paramsError(`$.${key}`, `${key} must be a boolean`) |
| 58 | return null |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | export function optionalFiniteNumber(key: string): ParamCheck { |
| 63 | return (record) => { |
no test coverage detected