Function
optionalStringArray
(args: Record<string, unknown>, key: string)
Source from the content-addressed store, hash-verified
| 90 | } |
| 91 | |
| 92 | function optionalStringArray(args: Record<string, unknown>, key: string): string[] | undefined { |
| 93 | const value = args[key] |
| 94 | if (value == null) return undefined |
| 95 | if (!Array.isArray(value) || !value.every((v) => typeof v === 'string')) { |
| 96 | throw new Error(`${key} must be an array of strings`) |
| 97 | } |
| 98 | return value as string[] |
| 99 | } |
| 100 | |
| 101 | /* ---------- Tool definitions ----------------------------------------- */ |
| 102 | |
Tested by
no test coverage detected