File tree Expand file tree Collapse file tree 4 files changed +28
-3
lines changed Expand file tree Collapse file tree 4 files changed +28
-3
lines changed Original file line number Diff line number Diff line change 984
984
"keyStop" : 0 ,
985
985
"step" : 0
986
986
},
987
+ "quit" : {
988
+ "arity" : 1 ,
989
+ "flags" : [
990
+ " loading" ,
991
+ " stale" ,
992
+ " readonly"
993
+ ],
994
+ "keyStart" : 0 ,
995
+ "keyStop" : 0 ,
996
+ "step" : 0
997
+ },
987
998
"randomkey" : {
988
999
"arity" : 1 ,
989
1000
"flags" : [
Original file line number Diff line number Diff line change @@ -10,9 +10,7 @@ var commands = require('./commands');
10
10
* @var {string[]}
11
11
* @public
12
12
*/
13
- var commandsList = Object . keys ( commands ) ;
14
- commandsList . push ( 'quit' ) ;
15
- exports . list = commandsList ;
13
+ exports . list = Object . keys ( commands ) ;
16
14
17
15
/**
18
16
* Check if the command has the flag
Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ describe('redis-commands', function () {
37
37
expect ( commands . hasFlag ( 'set' , 'fast' ) ) . to . eql ( false ) ;
38
38
expect ( commands . hasFlag ( 'set' , 'readonly' ) ) . to . eql ( false ) ;
39
39
expect ( commands . hasFlag ( 'select' , 'denyoom' ) ) . to . eql ( false ) ;
40
+ expect ( commands . hasFlag ( 'quit' , 'denyoom' ) ) . to . eql ( false ) ;
40
41
} ) ;
41
42
} ) ;
42
43
Original file line number Diff line number Diff line change @@ -24,6 +24,21 @@ redis.command(function (err, res) {
24
24
return prev ;
25
25
} , { } ) ;
26
26
27
+ // Future proof. Redis might implement this soon
28
+ if ( ! commands . quit ) {
29
+ commands . quit = {
30
+ arity : 1 ,
31
+ flags : [
32
+ 'loading' ,
33
+ 'stale' ,
34
+ 'readonly'
35
+ ] ,
36
+ keyStart : 0 ,
37
+ keyStop : 0 ,
38
+ step : 0
39
+ }
40
+ }
41
+
27
42
// Use json-stable-stringify instead fo JSON.stringify
28
43
// for easier diffing
29
44
var content = stringify ( commands , { space : ' ' } ) ;
You can’t perform that action at this time.
0 commit comments