( values: readonly string[] | null | undefined, )
| 1 | export function normalizeStringArray( |
| 2 | values: readonly string[] | null | undefined, |
| 3 | ): string[] { |
| 4 | if (!values || values.length === 0) return []; |
| 5 | |
| 6 | const seen = new Set<string>(); |
| 7 | const normalized: string[] = []; |
| 8 | |
| 9 | for (const value of values) { |
| 10 | const trimmed = value.trim(); |
| 11 | if (!trimmed) continue; |
| 12 | |
| 13 | const key = trimmed.toLowerCase(); |
| 14 | if (seen.has(key)) continue; |
| 15 | |
| 16 | seen.add(key); |
| 17 | normalized.push(trimmed); |
| 18 | } |
| 19 | |
| 20 | return normalized; |
| 21 | } |
no outgoing calls
no test coverage detected