1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00

Merge pull request #761 from vitaliylag/patch-1

Callback should be optional when using Array args. Closes #321 #502 #694 #398
This commit is contained in:
Ruben Bridgewater
2015-09-04 12:26:02 +02:00

View File

@@ -937,7 +937,7 @@ commands.forEach(function (fullCommand) {
var command = fullCommand.split(' ')[0]; var command = fullCommand.split(' ')[0];
RedisClient.prototype[command] = function (args, callback) { RedisClient.prototype[command] = function (args, callback) {
if (Array.isArray(args) && typeof callback === "function") { if (Array.isArray(args)) {
return this.send_command(command, args, callback); return this.send_command(command, args, callback);
} else { } else {
return this.send_command(command, to_array(arguments)); return this.send_command(command, to_array(arguments));