(value: unknown)
| 61 | |
| 62 | // Type guard: if not a cancel symbol, result must be a string array |
| 63 | function isStringArray(value: unknown): value is string[] { |
| 64 | return Array.isArray(value) && value.every((item) => typeof item === 'string'); |
| 65 | } |
| 66 | |
| 67 | // We can now use the type guard to ensure type safety |
| 68 | if (!isStringArray(result)) { |