(record: Record<string, unknown>, key: string)
| 421 | } |
| 422 | |
| 423 | function requiredString(record: Record<string, unknown>, key: string): RuntimeValidationResult<string> { |
| 424 | const value = record[key] |
| 425 | if (typeof value !== "string" || value.length < 1) return paramsError(`$.${key}`, `${key} must be a non-empty string`) |
| 426 | return { ok: true, value } |
| 427 | } |
| 428 | |
| 429 | export function validateRuntimeRequest(value: unknown): RuntimeValidationResult<RuntimeRequest> { |
| 430 | if (!isRecord(value)) return validationError("$", "Runtime request must be an object") |
no test coverage detected