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.
20 lines • 492 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.mapIntersect = void 0;
/**
* @public
* Does not check value equality, only key. Takes items from A.
*
* See {@link mapIntersect}.
*/
function mapIntersect(a, b) {
const result = new Map();
a.forEach((item, key) => {
if (b.has(key)) {
result.set(key, item);
}
});
return result;
}
exports.mapIntersect = mapIntersect;
//# sourceMappingURL=map-intersect.js.map