@sakuli/commons
Version:
22 lines • 739 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var create_lens_function_1 = require("./sources/create-lens.function");
var ObjectMap = /** @class */ (function () {
function ObjectMap(value) {
this.value = value;
this.cache = new Map();
this.lens = create_lens_function_1.createLens(value);
}
ObjectMap.prototype.get = function (key) {
if (!this.cache.has(key)) {
this.cache.set(key, this.lens(key.split('.')));
}
return this.cache.get(key);
};
ObjectMap.prototype.has = function (key) {
return !!this.get(key);
};
return ObjectMap;
}());
exports.ObjectMap = ObjectMap;
//# sourceMappingURL=object-map.class.js.map