lib/parser.js
function parseSimpleString (parser) {
  const start = parser.offset
  const buffer = parser.buffer
  const length = buffer.length - 1
  var offset = start

  while (offset < length) {
    if (buffer[offset++] === 13) { // \r\n
      parser.offset = offset + 1
      if (parser.optionReturnBuffers === true) {
        return parser.buffer.slice(start, offset - 1)
      }
      return parser.buffer.toString('utf8', start, offset - 1)
    }
  }
}
function parseSimpleString (parser) {
  const start = parser.offset
  const buffer = parser.buffer
  const length = buffer.length - 1
  var offset = start

  while (offset < length) {
    if (buffer[offset++] === 13) { // \r\n
      parser.offset = offset + 1
      if (parser.optionReturnBuffers === true) {
        return parser.buffer.slice(start, offset - 1)
      }
      return parser.buffer.toString('utf8', start, offset - 1)
    }
  }
}
function parseSimpleString ( parser ) { const start = parser . offset const buffer = parser . buffer const length = buffer . length - 1 var offset = start while ( offset < length ) { if ( buffer [ offset ++ ] === 13 ) { // \r\n parser . offset = offset + 1 if ( parser . optionReturnBuffers === true ) { return parser . buffer . slice ( start , offset - 1 ) } return parser . buffer . toString ( 'utf8' , start , offset - 1 ) } } }
Parse a '+' redis simple string response but forward the offsets
onto convertBufferRange to generate a string.
@param {JavascriptRedisParser} parser
@returns {undefined|string|Buffer}
Parse a + redis simple string response but forward the offsets onto convertBufferRange to generate a string .