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.
14 lines • 411 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.mapInitializeGet = void 0;
function mapInitializeGet(map, key, getValue) {
let value = map.get(key);
if (value !== undefined) {
return value;
}
value = getValue(key);
map.set(key, value);
return value;
}
exports.mapInitializeGet = mapInitializeGet;
//# sourceMappingURL=map-intialize-get.js.map