File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ var changeFunctionName = (function () {
2121// that provided a functionality to add new commands to the client
2222
2323commands . list . forEach ( function ( command ) {
24+ var commandName = command . replace ( / (?: ^ ( [ 0 - 9 ] ) | [ ^ a - z A - Z 0 - 9 _ $ ] ) / g, '_$1' ) ;
2425
2526 // Do not override existing functions
2627 if ( ! RedisClient . prototype [ command ] ) {
@@ -59,7 +60,7 @@ commands.list.forEach(function (command) {
5960 } ;
6061 if ( changeFunctionName ) {
6162 Object . defineProperty ( RedisClient . prototype [ command ] , 'name' , {
62- value : command
63+ value : commandName
6364 } ) ;
6465 }
6566 }
@@ -102,7 +103,7 @@ commands.list.forEach(function (command) {
102103 } ;
103104 if ( changeFunctionName ) {
104105 Object . defineProperty ( Multi . prototype [ command ] , 'name' , {
105- value : command
106+ value : commandName
106107 } ) ;
107108 }
108109 }
You can’t perform that action at this time.
0 commit comments