(key: string)
| 35 | } |
| 36 | |
| 37 | export function optionalString(key: string): ParamCheck { |
| 38 | return (record) => { |
| 39 | const value = record[key] |
| 40 | if (value !== undefined && typeof value !== "string") return paramsError(`$.${key}`, `${key} must be a string`) |
| 41 | return null |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | export function optionalStringEnum(key: string, values: readonly string[]): ParamCheck { |
| 46 | return (record) => { |
no test coverage detected