@type-cacheable/ioredis-adapter
Advanced tools
Comparing version 13.0.2 to 14.0.0
import { Cluster, Redis } from 'ioredis'; | ||
import { CacheClient } from '@type-cacheable/core'; | ||
import { CacheClient, CacheManagerOptions } from '@type-cacheable/core'; | ||
export declare class IoRedisAdapter implements CacheClient { | ||
@@ -17,2 +17,2 @@ constructor(redisClient: Redis | Cluster); | ||
} | ||
export declare const useAdapter: (client: Redis, asFallback?: boolean) => IoRedisAdapter; | ||
export declare const useAdapter: (client: Redis, asFallback?: boolean, options?: CacheManagerOptions) => IoRedisAdapter; |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
@@ -15,3 +38,3 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
const compare_versions_1 = require("compare-versions"); | ||
const core_1 = require("@type-cacheable/core"); | ||
const core_1 = __importStar(require("@type-cacheable/core")); | ||
const REDIS_VERSION_UNLINK_INTRODUCED = '4.0.0'; | ||
@@ -116,3 +139,3 @@ const REDIS_VERSION_FRAGMENT_IDENTIFIER = 'redis_version:'; | ||
exports.IoRedisAdapter = IoRedisAdapter; | ||
const useAdapter = (client, asFallback) => { | ||
const useAdapter = (client, asFallback, options) => { | ||
const ioRedisAdapter = new IoRedisAdapter(client); | ||
@@ -125,2 +148,5 @@ if (asFallback) { | ||
} | ||
if (options) { | ||
core_1.default.setOptions(options); | ||
} | ||
return ioRedisAdapter; | ||
@@ -127,0 +153,0 @@ }; |
{ | ||
"name": "@type-cacheable/ioredis-adapter", | ||
"version": "13.0.2", | ||
"version": "14.0.0", | ||
"description": "Adapter for using ioredis with type-cacheable", | ||
@@ -41,3 +41,3 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@type-cacheable/core": "^12.0.1", | ||
"@type-cacheable/core": "^13.0.0", | ||
"@types/ioredis": "^5.0.0", | ||
@@ -54,3 +54,3 @@ "ioredis": "^5.3.1", | ||
}, | ||
"gitHead": "2ada92dda969644761167f27f72a2711567eb0eb" | ||
"gitHead": "51bce5aa53eb0190529ca308fbeb6ae69c04ef39" | ||
} |
@@ -26,3 +26,3 @@ # @type-cacheable/ioredis-adapter | ||
```ts | ||
import * as IoRedis from 'ioredis'; | ||
import IoRedis from 'ioredis'; | ||
import { useAdapter } from '@type-cacheable/ioredis-adapter'; | ||
@@ -29,0 +29,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14891
168