mikro-orm-cache-adapter-redis
Advanced tools
Comparing version 0.1.5 to 1.0.0
import { CacheAdapter } from '@mikro-orm/core'; | ||
import { RedisOptions } from 'ioredis'; | ||
export interface RedisCacheAdapterOptions extends RedisOptions { | ||
import type { Redis, RedisOptions } from 'ioredis'; | ||
export interface BaseOptions { | ||
expiration?: number; | ||
debug?: boolean; | ||
} | ||
export interface BuildOptions extends BaseOptions, RedisOptions { | ||
} | ||
export interface ClientOptions extends BaseOptions { | ||
client: Redis; | ||
} | ||
export declare type RedisCacheAdapterOptions = BuildOptions | ClientOptions; | ||
export declare class RedisCacheAdapter implements CacheAdapter { | ||
@@ -8,0 +14,0 @@ private readonly client; |
@@ -57,8 +57,14 @@ "use strict"; | ||
function RedisCacheAdapter(options) { | ||
var _a = options.debug, debug = _a === void 0 ? false : _a, expiration = options.expiration, redisOpt = __rest(options, ["debug", "expiration"]); | ||
this.client = new ioredis_1.default(redisOpt); | ||
var _a = options.debug, debug = _a === void 0 ? false : _a, expiration = options.expiration; | ||
if (options.client) { | ||
this.client = options.client; | ||
} | ||
else { | ||
var _b = options, _c = _b.keyPrefix, keyPrefix = _c === void 0 ? 'mikro:' : _c, redisOpt = __rest(_b, ["keyPrefix"]); | ||
this.client = new ioredis_1.default(redisOpt); | ||
} | ||
this.debug = debug; | ||
this.expiration = expiration; | ||
if (this.debug) { | ||
console.log("redis client created", redisOpt); | ||
console.log("redis client created"); | ||
} | ||
@@ -65,0 +71,0 @@ } |
{ | ||
"name": "mikro-orm-cache-adapter-redis", | ||
"version": "0.1.5", | ||
"version": "1.0.0", | ||
"description": "A redis cache adapter for mikro-orm", | ||
@@ -16,9 +16,12 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@types/ioredis": "^4.19.1", | ||
"ioredis": "^4.19.4" | ||
"@types/ioredis": "^4.19.1" | ||
}, | ||
"devDependencies": { | ||
"@mikro-orm/core": "^4.3.4", | ||
"ioredis": "^4.22.0", | ||
"typescript": "^4.1.3" | ||
}, | ||
"peerDependencies": { | ||
"ioredis": "^4.22.0" | ||
}, | ||
"files": [ | ||
@@ -25,0 +28,0 @@ "dist" |
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
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
10715
8
167
1
1
49
3
- Removedioredis@^4.19.4