( contexts: string[] | undefined, context: string )
| 86 | } |
| 87 | |
| 88 | export function addContextToList( |
| 89 | contexts: string[] | undefined, |
| 90 | context: string |
| 91 | ): string[] | undefined { |
| 92 | const value = normalizeContextValue(context); |
| 93 | const current = normalizeContextList(contexts); |
| 94 | if (!value) return current.length > 0 ? current : undefined; |
| 95 | if (current.includes(value)) return current; |
| 96 | return [...current, value]; |
| 97 | } |
| 98 | |
| 99 | export function removeContextFromList( |
| 100 | contexts: string[] | undefined, |
no test coverage detected