You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
792 B
30 lines
792 B
/**
|
|
* 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
|