( list: string[], name: string, shouldContain: boolean, )
| 1536 | } |
| 1537 | |
| 1538 | function toggleMembership( |
| 1539 | list: string[], |
| 1540 | name: string, |
| 1541 | shouldContain: boolean, |
| 1542 | ): string[] { |
| 1543 | const contains = list.includes(name) |
| 1544 | if (contains === shouldContain) return list |
| 1545 | return shouldContain ? [...list, name] : list.filter(s => s !== name) |
| 1546 | } |
| 1547 | |
| 1548 | /** |
| 1549 | * Enable or disable an MCP server |
no outgoing calls
no test coverage detected