Rush StackShopBlogEvents
Skip to main content

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

ParameterTypeDescription
targetMapMap<K, V>The map that entries will be added to
sourceMapReadonlyMap<K, V>The map containing the entries to be added

Returns:

void

Remarks

This function modifies targetMap. Any existing keys will be overwritten.