Skip to content

Commit 50774ae

Browse files
committed
fix: accept UPPER_CASE commands in send_command
1 parent 789471b commit 50774ae

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,7 +705,6 @@ accessed via the redis SELECT command. Each DB could use its own connection.
705705

706706
All Redis commands have been added to the `client` object. However, if new commands are introduced before this library is updated,
707707
you can use `send_command()` to send arbitrary commands to Redis.
708-
The command_name has to be lower case.
709708

710709
All commands are sent as multi-bulk commands. `args` can either be an Array of arguments, or omitted / set to undefined.
711710

changelog.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Changelog
22

3-
## v.2.7.2 - 14 Mar, 2017
3+
## v.2.8.0 - 20 Jul, 2017
4+
5+
Features
6+
7+
- Accept UPPER_CASE commands in send_command
48

59
Bugfixes
610

lib/extendedApi.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ RedisClient.prototype.send_command = RedisClient.prototype.sendCommand = functio
1616
if (typeof command !== 'string') {
1717
throw new TypeError('Wrong input type "' + (command !== null && command !== undefined ? command.constructor.name : command) + '" for command name');
1818
}
19+
command = command.toLowerCase();
1920
if (!Array.isArray(args)) {
2021
if (args === undefined || args === null) {
2122
args = [];
@@ -32,9 +33,9 @@ RedisClient.prototype.send_command = RedisClient.prototype.sendCommand = functio
3233

3334
// Using the raw multi command is only possible with this function
3435
// If the command is not yet added to the client, the internal function should be called right away
35-
// Otherwise we need to redirect the calls to make sure the interal functions don't get skipped
36+
// Otherwise we need to redirect the calls to make sure the internal functions don't get skipped
3637
// The internal functions could actually be used for any non hooked function
37-
// but this might change from time to time and at the moment there's no good way to distinguishe them
38+
// but this might change from time to time and at the moment there's no good way to distinguish them
3839
// from each other, so let's just do it do it this way for the time being
3940
if (command === 'multi' || typeof this[command] !== 'function') {
4041
return this.internal_send_command(new Command(command, args, callback));

0 commit comments

Comments
 (0)