(key: string)
| 68 | } |
| 69 | |
| 70 | export function requiredPositiveInteger(key: string): ParamCheck { |
| 71 | return (record) => { |
| 72 | const value = record[key] |
| 73 | if (typeof value !== "number" || !Number.isInteger(value) || value < 1) return paramsError(`$.${key}`, `${key} must be a positive integer`) |
| 74 | return null |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | export function optionalPositiveInteger(key: string): ParamCheck { |
| 79 | return (record) => { |
no test coverage detected