UNPKG

rc-js-util

Version:

A collection of TS and C++ utilities to help writing performant and correct applications, achieved through strict typing and (removable) invariant checking.

18 lines 523 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.mapUnion = void 0; /** * @public * Returns a map with keys from both A and B. If both A and B have the same key the value from B will be used. * * @remarks * See {@link mapUnion}. */ function mapUnion(a, b) { const result = new Map(); a.forEach((item, key) => result.set(key, item)); b.forEach((item, key) => result.set(key, item)); return result; } exports.mapUnion = mapUnion; //# sourceMappingURL=map-union.js.map