@venix/cachified
Version:
A plug and play NestJS redis cache for intensive functions.
13 lines • 662 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Cachified = void 0;
const common_1 = require("@nestjs/common");
const util_1 = require("../util");
function Cachified(expirySecondsOrOptions, options) {
if (!options)
options = typeof expirySecondsOrOptions === 'number' ? {} : (expirySecondsOrOptions || {});
const expirySeconds = typeof expirySecondsOrOptions === 'number' ? expirySecondsOrOptions : 24 * 60 * 60;
return common_1.SetMetadata(util_1.CACHIFIED_DECORATOR, Object.assign({ expirySeconds }, options));
}
exports.Cachified = Cachified;
//# sourceMappingURL=cachified.decorator.js.map