xl-infinite-tree
Version:
A browser-ready tree library that can efficiently display a large amount of data using infinite scrolling.
40 lines (29 loc) • 953 B
JavaScript
;
exports.__esModule = true;
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var LookupTable = function () {
function LookupTable() {
_classCallCheck(this, LookupTable);
this.data = {};
}
LookupTable.prototype.clear = function clear() {
this.data = {};
};
LookupTable.prototype.get = function get(key) {
return this.data[key];
};
LookupTable.prototype.has = function has(key) {
return this.data[key] !== undefined;
};
LookupTable.prototype.set = function set(key, value) {
this.data[key] = value;
return value;
};
LookupTable.prototype.unset = function unset(key) {
if (this.data[key] !== undefined) {
delete this.data[key];
}
};
return LookupTable;
}();
exports["default"] = LookupTable;