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.

19 lines 445 B
export 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; } } //# sourceMappingURL=map-reporting-add-to-set.js.map