@maxverse/media-web-sdk
Version:
34 lines (31 loc) • 1.47 kB
JavaScript
import { createClass as _createClass, classCallCheck as _classCallCheck, classPrivateFieldLooseBase as _classPrivateFieldLooseBase, classPrivateFieldLooseKey as _classPrivateFieldLooseKey } from '../_virtual/_rollupPluginBabelHelpers.mjs';
var _cache = /*#__PURE__*/_classPrivateFieldLooseKey("cache");
var _getCacheKey = /*#__PURE__*/_classPrivateFieldLooseKey("getCacheKey");
/* eslint-disable no-prototype-builtins */
/* eslint-disable @typescript-eslint/no-explicit-any */
var Cache = /*#__PURE__*/_createClass(function Cache() {
var _this = this;
_classCallCheck(this, Cache);
Object.defineProperty(this, _cache, {
writable: true,
value: void 0
});
Object.defineProperty(this, _getCacheKey, {
writable: true,
value: function value(key) {
return JSON.stringify(key);
}
});
this.hasKey = function (key) {
return _classPrivateFieldLooseBase(_this, _cache)[_cache].hasOwnProperty(_classPrivateFieldLooseBase(_this, _getCacheKey)[_getCacheKey](key));
};
this.setValue = function (key, value) {
_classPrivateFieldLooseBase(_this, _cache)[_cache][_classPrivateFieldLooseBase(_this, _getCacheKey)[_getCacheKey](key)] = value;
};
this.getValue = function (key) {
return _classPrivateFieldLooseBase(_this, _cache)[_cache][_classPrivateFieldLooseBase(_this, _getCacheKey)[_getCacheKey](key)];
};
_classPrivateFieldLooseBase(this, _cache)[_cache] = {};
});
var Cache$1 = Cache;
export { Cache$1 as default };