Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[minor] Small refactor of the different response type's lookups

  • Loading branch information...
commit 9c475414878faf44e85bc78b1db32564f53d6dbc 1 parent f15e6e4
@3rd-Eden authored
Showing with 16 additions and 17 deletions.
  1. +16 −17 index.js
View
33 index.js
@@ -49,26 +49,25 @@ Parser.prototype.__proto__ = Stream.prototype;
*/
Parser.responses = Object.create(null);
[
- 'CLIENT_ERROR' // CLIENT_ERROR <error> \r\n -- Protocol failed
- , 'DELETED' // DELETED\r\n -- Value deleted
- , 'END' // END\r\n -- Done
- , 'ERROR' // ERROR\r\n -- Command not known
- , 'EXISTS' // EXISTS\r\n -- Item has been modified
- , 'NOT_FOUND' // NOT_FOUND\r\n -- OK, but item not found
- , 'NOT_STORED' // NOT_STORED\r\n -- OK, but not stored
- , 'OK' // OK\r\n -- OK
- , 'SERVER_ERROR' // SERVER_ERROR <error> \r\n -- Server fuckup
- , 'STAT' // STAT <name> <value>\r\n -- Server stats
- , 'STORED' // STORED\r\n -- Saved response
- , 'TOUCHED' // TOUCHED\r\n -- That tickles
- , 'VALUE' // VALUE <key> <flags> <bytes> [<cas unique>]\r\n -- ok
- , 'VERSION' // VERSION <version>\r\n -- Server version
-
+ 'CLIENT_ERROR' // (00) CLIENT_ERROR <error> \r\n -- Protocol failed
+ , 'DELETED' // (01) DELETED\r\n -- Value deleted
+ , 'END' // (02) END\r\n -- Done
+ , 'ERROR' // (03) ERROR\r\n -- Command not known
+ , 'EXISTS' // (04) EXISTS\r\n -- Item has been modified
+ , 'NOT_FOUND' // (05) NOT_FOUND\r\n -- OK, but item not found
+ , 'NOT_STORED' // (06) NOT_STORED\r\n -- OK, but not stored
+ , 'OK' // (07) OK\r\n -- OK
+ , 'SERVER_ERROR' // (08) SERVER_ERROR <error> \r\n -- Server fuckup
+ , 'STAT' // (09) STAT <name> <value>\r\n -- Server stats
+ , 'STORED' // (10) STORED\r\n -- Saved response
+ , 'TOUCHED' // (11) TOUCHED\r\n -- That tickles
+ , 'VALUE' // (12) VALUE <key> <flags> <bytes> [<cas unique>]\r\n -- ok
+ , 'VERSION' // (13) VERSION <version>\r\n -- Server version
+ , 'INCR/DECR' // (14) <number>\r\n -- Incr response
// <number> <count>\r\n -- Size stat response
- // <number>\r\n -- Incr response
// Ignoring SLAB reassignment, doesn't seem to be finished.
].forEach(function commanding(command, i) {
- Parser.responses[command] = i;
+ Parser.responses[i] = command;
});
/**
Please sign in to comment.
Something went wrong with that request. Please try again.