Skip to content

Commit e9ca5d4

Browse files
authored
Merge pull request #14 from moaxaca/develop
Release/v1.1.5
2 parents e02adc7 + c9bbb0e commit e9ca5d4

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"private": false,
3-
"version": "1.1.4",
3+
"version": "1.1.5",
44
"name": "async-redis",
55
"keywords": [
66
"redis",

src/index.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,13 @@ const AsyncRedis = function (args) {
1111

1212
AsyncRedis.createClient = (...args) => new AsyncRedis(args);
1313

14+
// this is the set of commands to NOT promisify
15+
const commandsToSkipSet = new Set(['multi']);
16+
// this is the set of commands to promisify
17+
const commandSet = new Set(commands.filter(c => !commandsToSkipSet.has(c)));
18+
1419
AsyncRedis.decorate = redisClient => objectDecorator(redisClient, (name, method) => {
15-
if (commands.includes(name)) {
20+
if (commandSet.has(name)) {
1621
return (...args) => new Promise((resolve, reject) => {
1722
args.push((error, ...results) => {
1823
if (error) {

test/integration/commands/common.spec.js

+8
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,12 @@ describe('Commands - Common', function () {
5454
assert.isRejected(promise, Error);
5555
});
5656
});
57+
58+
describe('test multi not a promise', function () {
59+
it('should be not equal', async () => {
60+
let notAPromise = redisClient.multi();
61+
console.log(notAPromise);
62+
assert.notEqual(Promise.resolve(notAPromise), notAPromise);
63+
});
64+
});
5765
});

0 commit comments

Comments
 (0)