(args: Record<string, unknown>, key: string)
| 501 | } |
| 502 | |
| 503 | function optionalString(args: Record<string, unknown>, key: string) { |
| 504 | const value = args[key] |
| 505 | if (value === undefined || value === null || value === "") return undefined |
| 506 | if (typeof value !== "string") throw new Error(`${key} must be a string`) |
| 507 | return value |
| 508 | } |
| 509 | |
| 510 | function requiredString(args: Record<string, unknown>, key: string) { |
| 511 | const value = optionalString(args, key) |
no outgoing calls
no test coverage detected