@antv/util
Version:
> AntV 底层依赖的工具库,不建议在自己业务中使用。
30 lines • 792 B
JavaScript
/**
* k-v 存储
*/
var default_1 = /** @class */ (function () {
function default_1() {
this.map = {};
}
default_1.prototype.has = function (key) {
return this.map[key] !== undefined;
};
default_1.prototype.get = function (key, def) {
var v = this.map[key];
return v === undefined ? def : v;
};
default_1.prototype.set = function (key, value) {
this.map[key] = value;
};
default_1.prototype.clear = function () {
this.map = {};
};
default_1.prototype.delete = function (key) {
delete this.map[key];
};
default_1.prototype.size = function () {
return Object.keys(this.map).length;
};
return default_1;
}());
export default default_1;
//# sourceMappingURL=cache.js.map