Skip to content

Commit 2561d79

Browse files
authored
Some syntax + comment updates
1 parent d55b9ca commit 2561d79

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

lib/redis-store.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,15 @@ var RedisStore = function(options) {
2222
return cb(err);
2323
}
2424

25-
//in ioredis, every reply consists of an array [err, value]. We don't need the error here.
26-
//if we aren't dealing with an array, nothing is changed
27-
replies.map(function(val, index) {
28-
if (typeof val === 'object' && val.constructor === Array) {
29-
replies[index] = val[1];
25+
// in ioredis, every reply consists of an array [err, value].
26+
// We don't need the error here, and if we aren't dealing with an array,
27+
// nothing is changed.
28+
replies = replies.map(function(val, index) {
29+
if (Array.isArray(val) && val.length >= 2) {
30+
return val[1];
3031
}
32+
33+
return val;
3134
});
3235

3336
// if this is new or has no expiry

0 commit comments

Comments
 (0)