(...keys: string[])
| 209 | } |
| 210 | |
| 211 | function validateStringParams(...keys: string[]) { |
| 212 | return (params: unknown): RuntimeValidationResult<Record<string, unknown>> => { |
| 213 | const record = validateRecordParams(params) |
| 214 | if (!record.ok) return record |
| 215 | for (const key of keys) { |
| 216 | if (typeof record.value[key] !== "string" || record.value[key].length < 1) return paramsError(`$.${key}`, `${key} must be a non-empty string`) |
| 217 | } |
| 218 | return record |
| 219 | } |
| 220 | } |
| 221 | |
| 222 | function validateRequestIdParams(params: unknown): RuntimeValidationResult<Record<string, unknown>> { |
| 223 | const record = validateRecordParams(params) |
no test coverage detected