@melchyore/adonis-cache
Version:
Cache package for AdonisJS V5
22 lines (21 loc) • 759 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const Repository_1 = __importDefault(require("./Repository"));
const Utils_1 = __importDefault(require("./Utils"));
class TaggedCache extends Repository_1.default {
constructor(_store, _tags, _prefix) {
super(_store, _prefix);
this._tags = _tags;
this._prefix = _prefix;
}
async taggedItemKey(key) {
return Utils_1.default.sha1(await this._tags.getNamespace()) + ':' + key;
}
itemKey(key) {
return this.taggedItemKey(key);
}
}
exports.default = TaggedCache;