(args: Record<string, unknown>, key: string)
| 58 | /* ---------- Argument helpers ----------------------------------------- */ |
| 59 | |
| 60 | function requireString(args: Record<string, unknown>, key: string): string { |
| 61 | const value = args[key] |
| 62 | if (typeof value !== 'string' || !value.trim()) { |
| 63 | throw new Error(`Missing required string argument: ${key}`) |
| 64 | } |
| 65 | return value |
| 66 | } |
| 67 | |
| 68 | function optionalString(args: Record<string, unknown>, key: string): string | undefined { |
| 69 | const value = args[key] |
no outgoing calls
no test coverage detected