1234567891011121314151617181920212223242526272829303132 |
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- /**
- * 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;
- }());
- exports.default = default_1;
- //# sourceMappingURL=cache.js.map
|