(contexts: string[] | undefined)
| 71 | } |
| 72 | |
| 73 | function normalizeContextList(contexts: string[] | undefined): string[] { |
| 74 | const seen = new Set<string>(); |
| 75 | const normalized: string[] = []; |
| 76 | |
| 77 | for (const context of contexts ?? []) { |
| 78 | if (typeof context !== "string") continue; |
| 79 | const value = normalizeContextValue(context); |
| 80 | if (!value || seen.has(value)) continue; |
| 81 | seen.add(value); |
| 82 | normalized.push(value); |
| 83 | } |
| 84 | |
| 85 | return normalized; |
| 86 | } |
| 87 | |
| 88 | export function addContextToList( |
| 89 | contexts: string[] | undefined, |
no test coverage detected