(record: Record<string, unknown>, key: string)
| 414 | } |
| 415 | |
| 416 | function optionalString(record: Record<string, unknown>, key: string): RuntimeValidationResult<string | undefined> { |
| 417 | const value = record[key] |
| 418 | if (value === undefined) return { ok: true, value: undefined } |
| 419 | if (typeof value !== "string") return paramsError(`$.${key}`, `${key} must be a string`) |
| 420 | return { ok: true, value } |
| 421 | } |
| 422 | |
| 423 | function requiredString(record: Record<string, unknown>, key: string): RuntimeValidationResult<string> { |
| 424 | const value = record[key] |
no test coverage detected