(source: Map<K, V>, keep: Set<K>)
| 240 | } |
| 241 | |
| 242 | function copyMap<K, V>(source: Map<K, V>, keep: Set<K>) { |
| 243 | const out = new Map<K, V>() |
| 244 | for (const [key, value] of source) { |
| 245 | if (!keep.has(key)) { |
| 246 | continue |
| 247 | } |
| 248 | |
| 249 | out.set(key, value) |
| 250 | } |
| 251 | return out |
| 252 | } |
| 253 | |
| 254 | function compactToolPart(part: ToolPart): ToolPart { |
| 255 | return { |
no test coverage detected