@squareboat/nest-cache
Version:
The cache package for your NestJS Applications
22 lines (21 loc) • 732 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CacheStore = exports.Cache = void 0;
const metadata_1 = require("./metadata");
const service_1 = require("./service");
const expParser_1 = require("./utils/expParser");
class Cache {
static store(store) {
const options = metadata_1.CacheMetadata.getData();
return service_1.CacheService.stores[store || options.default];
}
static genKey(obj) {
return expParser_1.ExpParser.buildFromObj(obj);
}
}
exports.Cache = Cache;
function CacheStore(store) {
const options = metadata_1.CacheMetadata.getData();
return service_1.CacheService.stores[store || options.default];
}
exports.CacheStore = CacheStore;