(value: unknown)
| 427 | } |
| 428 | |
| 429 | export function validateRuntimeRequest(value: unknown): RuntimeValidationResult<RuntimeRequest> { |
| 430 | if (!isRecord(value)) return validationError("$", "Runtime request must be an object") |
| 431 | if (!isRequestId(value.id)) return validationError("$.id", "Runtime request id must be a string or finite number") |
| 432 | if (typeof value.method !== "string" || value.method.length < 1) return validationError("$.method", "Runtime request method must be a non-empty string") |
| 433 | return { ok: true, value: value as unknown as RuntimeRequest } |
| 434 | } |
| 435 | |
| 436 | export function validateRuntimeResponse(value: unknown): RuntimeValidationResult<RuntimeResponse> { |
| 437 | if (!isRecord(value)) return validationError("$", "Runtime response must be an object") |
no test coverage detected