* Returns a new code Map snapshot of the multimap, with each key * mapped to a fresh array of its values in insertion order. * * The returned map and its value arrays are owned by the caller; mutating * them does not affect the multimap, and later mutations to the multimap * ar
()
| 639 | * ``` |
| 640 | */ |
| 641 | toMap(): Map<K, V[]> { |
| 642 | const result = new Map<K, V[]>(); |
| 643 | for (const [key, list] of this.#map) { |
| 644 | result.set(key, list.slice()); |
| 645 | } |
| 646 | return result; |
| 647 | } |
| 648 | |
| 649 | /** |
| 650 | * Returns an iterator of all `[key, value]` pairs, with each value yielded |
no test coverage detected