diff --git a/changelog.md b/changelog.md index 8694afa4a4..74630e63a7 100644 --- a/changelog.md +++ b/changelog.md @@ -10,6 +10,7 @@ Features - Updated [redis-parser](https://github.com/NodeRedis/redis-parser) dependency ([changelog](https://github.com/NodeRedis/redis-parser/releases/tag/v.2.0.0)) - The JS parser is from now on the new default as it is a lot faster than the hiredis parser - This is no BC as there is no changed behavior for the user at all but just a performance improvement. Explicitly requireing the Hiredis parser is still possible. +- Added name property to all Redis functions Bugfixes diff --git a/lib/commands.js b/lib/commands.js index a99d025714..fc20ff8165 100644 --- a/lib/commands.js +++ b/lib/commands.js @@ -44,6 +44,9 @@ commands.list.forEach(function (command) { } return this.internal_send_command(command, arr, callback); }; + Object.defineProperty(RedisClient.prototype[command], 'name', { + value: command + }); } // Do not override existing functions @@ -82,5 +85,8 @@ commands.list.forEach(function (command) { this.queue.push([command, arr, callback]); return this; }; + Object.defineProperty(Multi.prototype[command], 'name', { + value: command + }); } }); diff --git a/lib/individualCommands.js b/lib/individualCommands.js index 808ad99a0b..d676b0ce7a 100644 --- a/lib/individualCommands.js +++ b/lib/individualCommands.js @@ -96,7 +96,7 @@ function quit_callback (self, callback) { }; } -RedisClient.prototype.QUIT = RedisClient.prototype.quit = function (callback) { +RedisClient.prototype.QUIT = RedisClient.prototype.quit = function quit (callback) { // TODO: Consider this for v.3 // Allow the quit command to be fired as soon as possible to prevent it landing in the offline queue. // this.ready = this.offline_queue.length === 0; @@ -108,7 +108,7 @@ RedisClient.prototype.QUIT = RedisClient.prototype.quit = function (callback) { }; // Only works with batch, not in a transaction -Multi.prototype.QUIT = Multi.prototype.quit = function (callback) { +Multi.prototype.QUIT = Multi.prototype.quit = function quit (callback) { var self = this._client; var call_on_write = function () { // If called in a multi context, we expect redis is available