(value: unknown)
| 448 | } |
| 449 | |
| 450 | export function validateRuntimeNotification(value: unknown): RuntimeValidationResult<RuntimeNotification> { |
| 451 | if (!isRecord(value)) return validationError("$", "Runtime notification must be an object") |
| 452 | if ("id" in value) return validationError("$.id", "Runtime notification must not include an id") |
| 453 | if (typeof value.method !== "string" || value.method.length < 1) { |
| 454 | return validationError("$.method", "Runtime notification method must be a non-empty string") |
| 455 | } |
| 456 | if ("cursor" in value && typeof value.cursor !== "string") return validationError("$.cursor", "Runtime notification cursor must be a string") |
| 457 | return { ok: true, value: value as unknown as RuntimeNotification } |
| 458 | } |
| 459 | |
| 460 | export function validateRuntimeScope(value: unknown): RuntimeValidationResult<RuntimeScope> { |
| 461 | if (!isRecord(value)) return validationError("$", "Runtime scope must be an object") |
no test coverage detected