@keyv/redis 2.3.8 → 2.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +19 -3
- package/src/index.d.ts +10 -8
- package/src/index.js +0 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keyv/redis",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.9",
|
|
4
4
|
"description": "Redis storage adapter for Keyv",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -11,12 +11,26 @@
|
|
|
11
11
|
"xo": {
|
|
12
12
|
"rules": {
|
|
13
13
|
"unicorn/prefer-module": 0,
|
|
14
|
-
"unicorn/prefer-node-protocol": 0
|
|
14
|
+
"unicorn/prefer-node-protocol": 0,
|
|
15
|
+
"ava/no-ignored-test-files": [
|
|
16
|
+
"error",
|
|
17
|
+
{
|
|
18
|
+
"extensions": [
|
|
19
|
+
"js",
|
|
20
|
+
"ts"
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
]
|
|
15
24
|
}
|
|
16
25
|
},
|
|
17
26
|
"ava": {
|
|
18
27
|
"require": [
|
|
19
|
-
"requirable"
|
|
28
|
+
"requirable",
|
|
29
|
+
"ts-node/register"
|
|
30
|
+
],
|
|
31
|
+
"extensions": [
|
|
32
|
+
"js",
|
|
33
|
+
"ts"
|
|
20
34
|
]
|
|
21
35
|
},
|
|
22
36
|
"repository": {
|
|
@@ -47,8 +61,10 @@
|
|
|
47
61
|
"@keyv/test-suite": "*",
|
|
48
62
|
"ava": "^4.3.0",
|
|
49
63
|
"delay": "^5.0.0",
|
|
64
|
+
"@types/keyv": "^3.1.4",
|
|
50
65
|
"keyv": "*",
|
|
51
66
|
"nyc": "^15.1.0",
|
|
67
|
+
"ts-node": "^10.8.2",
|
|
52
68
|
"requirable": "^1.0.5",
|
|
53
69
|
"this": "^1.1.0",
|
|
54
70
|
"tsd": "^0.22.0",
|
package/src/index.d.ts
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
import {EventEmitter} from 'events';
|
|
2
|
-
import {Store} from 'keyv';
|
|
2
|
+
import {Store, StoredData} from 'keyv';
|
|
3
3
|
import {Redis, Cluster} from 'ioredis';
|
|
4
4
|
|
|
5
|
-
declare class KeyvRedis extends EventEmitter implements Store<
|
|
5
|
+
declare class KeyvRedis extends EventEmitter implements Store<Value> {
|
|
6
6
|
readonly ttlSupport: false;
|
|
7
7
|
namespace?: string | undefined;
|
|
8
8
|
opts: Record<string, unknown>;
|
|
9
9
|
redis: any;
|
|
10
10
|
constructor(options?: KeyvRedis.Options | Redis | Cluster);
|
|
11
11
|
constructor(uri: string | Redis | Cluster, options?: KeyvRedis.Options);
|
|
12
|
-
get(key: string): Promise<
|
|
13
|
-
getMany(
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
get(key: string): Promise<Value>;
|
|
13
|
+
getMany?(
|
|
14
|
+
keys: string[]
|
|
15
|
+
): Array<StoredData<Value>> | Promise<Array<StoredData<Value>>> | undefined;
|
|
16
|
+
set(key: string, value: Value, ttl?: number): any;
|
|
17
|
+
delete(key: string): boolean | Promise<boolean>;
|
|
16
18
|
deleteMany(keys: string[]): boolean;
|
|
17
|
-
clear(): Promise<void>;
|
|
19
|
+
clear(): void | Promise<void>;
|
|
18
20
|
iterator(namespace: string | undefined): AsyncGenerator<any, void, any>;
|
|
19
|
-
has(key: string): boolean
|
|
21
|
+
has?(key: string): boolean | Promise<boolean>;
|
|
20
22
|
}
|
|
21
23
|
declare namespace KeyvRedis {
|
|
22
24
|
interface Options {
|
package/src/index.js
CHANGED
|
@@ -49,12 +49,9 @@ class KeyvRedis extends EventEmitter {
|
|
|
49
49
|
return this.redis.set(key, value, 'PX', ttl);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
console.log('return in set', this.redis);
|
|
53
|
-
|
|
54
52
|
return this.redis.set(key, value);
|
|
55
53
|
})
|
|
56
54
|
.then(() => {
|
|
57
|
-
console.log('return');
|
|
58
55
|
this.redis.sadd(this._getNamespace(), key);
|
|
59
56
|
});
|
|
60
57
|
}
|