UNPKG

use-cache-helper

Version:

use-cache-helper provides helper functions to easily manage and scale your redis and database caching strategies.

18 lines 555 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.checkRedis = void 0; const errors_1 = require("./errors"); const store_1 = require("./store"); /** * Check both redis(ioredis & upstash) instance reference. * Throws an error if neither is present. * @returns */ const checkRedis = () => { if (!store_1.store?.redis && !store_1.store?.upstashRedis) { throw new errors_1.UseCacheError('Missing redis instance'); } return true; }; exports.checkRedis = checkRedis; //# sourceMappingURL=helpers.js.map