(map: Map<Key, ValueItem[]>,
key: Key, value: ValueItem)
| 16 | */ |
| 17 | |
| 18 | export function pushIntoMapOfArrays<Key, ValueItem>(map: Map<Key, ValueItem[]>, |
| 19 | key: Key, value: ValueItem) { |
| 20 | const existingValues = map.get(key); |
| 21 | if (existingValues === undefined) { |
| 22 | map.set(key, [value]); |
| 23 | return; |
| 24 | } |
| 25 | existingValues.push(value); |
| 26 | } |
no test coverage detected