UNPKG

johnycash

Version:

Easy distributed caching for Node.js

30 lines 868 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.LockCacheSettings = exports.LockerOptions = exports.CacheSetting = void 0; class CacheSetting { getKey() { return `${this.prefix}_${this.suffix}`; } constructor(init) { this.refreshTtl = true; Object.assign(this, init); } } exports.CacheSetting = CacheSetting; class LockerOptions { constructor(init) { Object.assign(this, init); } } exports.LockerOptions = LockerOptions; class LockCacheSettings extends CacheSetting { static getTtl(lockCacheSettings) { return lockCacheSettings.remoteTtl ? lockCacheSettings.remoteTtl * 1000 : 0; } constructor(init) { super(init); Object.assign(this, init); } } exports.LockCacheSettings = LockCacheSettings; //# sourceMappingURL=cache-settings.js.map