Home > @rushstack/node-core-library > MapExtensions > mergeFromMap
MapExtensions.mergeFromMap() method
Adds all the (key, value) pairs from the source map into the target map.
Signature:
static mergeFromMap<K, V>(targetMap: Map<K, V>, sourceMap: ReadonlyMap<K, V>): void;
Parameters
Parameter | Type | Description |
---|---|---|
targetMap | Map<K, V> | The map that entries will be added to |
sourceMap | ReadonlyMap<K, V> | The map containing the entries to be added |
Returns:
void
Remarks
This function modifies targetMap. Any existing keys will be overwritten.