redis-smq-common 1.0.0-rc.6 → 1.0.0-rc.7

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/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## 1.0.0-rc.6 (2022-05-30)
4
4
 
5
+ * Fix various redis errors (9349261)
6
+
7
+ ## 1.0.0-rc.6 (2022-05-30)
8
+
5
9
  * Fix missing RedisClient from package exports (88f90f0)
6
10
 
7
11
  ## 1.0.0-rc.5 (2022-05-30)
@@ -43,7 +43,7 @@ class IoredisClientMulti {
43
43
  return this;
44
44
  }
45
45
  srem(key, element) {
46
- this.multi.srem(key, ...element);
46
+ this.multi.srem(key, ...(typeof element === 'string' ? [element] : element));
47
47
  return this;
48
48
  }
49
49
  hset(key, field, value) {
@@ -63,7 +63,7 @@ class IoredisClientMulti {
63
63
  return this;
64
64
  }
65
65
  del(key) {
66
- this.multi.del(...key);
66
+ this.multi.del(...(typeof key === 'string' ? [key] : key));
67
67
  return this;
68
68
  }
69
69
  exec(cb) {
@@ -110,7 +110,7 @@ class NodeRedisV3Client extends redis_client_1.RedisClient {
110
110
  this.client.hset(key, field, value, cb);
111
111
  }
112
112
  hdel(key, fields, cb) {
113
- this.client.hdel(key, fields, cb);
113
+ this.client.hdel(key, ...(typeof fields === 'string' ? [fields] : fields), cb);
114
114
  }
115
115
  lrange(key, start, stop, cb) {
116
116
  this.client.lrange(key, start, stop, cb);
@@ -166,7 +166,7 @@ class NodeRedisV3Client extends redis_client_1.RedisClient {
166
166
  this.client.get(key, cb);
167
167
  }
168
168
  del(key, cb) {
169
- this.client.del(key, cb);
169
+ this.client.del(...(typeof key === 'string' ? [key] : key), cb);
170
170
  }
171
171
  llen(key, cb) {
172
172
  this.client.llen(key, cb);
@@ -215,8 +215,8 @@ class NodeRedisV4Client extends redis_client_1.RedisClient {
215
215
  }
216
216
  del(key, cb) {
217
217
  this.client
218
- .sendCommand(['del', ...(Array.isArray(key) ? key : [key])])
219
- .then((reply) => cb(null, Number(reply)))
218
+ .del(key)
219
+ .then((reply) => cb(null, reply))
220
220
  .catch(cb);
221
221
  }
222
222
  llen(key, cb) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "redis-smq-common",
3
- "version": "1.0.0-rc.6",
3
+ "version": "1.0.0-rc.7",
4
4
  "description": "RedisSMQ shared components that may be used by integrated applications and extensions.",
5
5
  "author": "Weyoss <weyoss@protonmail.com>",
6
6
  "license": "MIT",