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.
23 lines • 607 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.mapReportingAddToSet = void 0;
function mapReportingAddToSet(map, key, value) {
const values = map.get(key);
if (values != null) {
if (values.has(value)) {
return false;
}
else {
values.add(value);
return true;
}
}
else {
const set = new Set();
set.add(value);
map.set(key, set);
return true;
}
}
exports.mapReportingAddToSet = mapReportingAddToSet;
//# sourceMappingURL=map-reporting-add-to-set.js.map