File tree 1 file changed +3
-2
lines changed
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ var changeFunctionName = (function () {
21
21
// that provided a functionality to add new commands to the client
22
22
23
23
commands . list . forEach ( function ( command ) {
24
+ var commandName = command . replace ( / (?: ^ ( [ 0 - 9 ] ) | [ ^ a - z A - Z 0 - 9 _ $ ] ) / g, '_$1' ) ;
24
25
25
26
// Do not override existing functions
26
27
if ( ! RedisClient . prototype [ command ] ) {
@@ -59,7 +60,7 @@ commands.list.forEach(function (command) {
59
60
} ;
60
61
if ( changeFunctionName ) {
61
62
Object . defineProperty ( RedisClient . prototype [ command ] , 'name' , {
62
- value : command
63
+ value : commandName
63
64
} ) ;
64
65
}
65
66
}
@@ -102,7 +103,7 @@ commands.list.forEach(function (command) {
102
103
} ;
103
104
if ( changeFunctionName ) {
104
105
Object . defineProperty ( Multi . prototype [ command ] , 'name' , {
105
- value : command
106
+ value : commandName
106
107
} ) ;
107
108
}
108
109
}
You can’t perform that action at this time.
0 commit comments