lib/parser.js
function concatBulkString (parser) {
  const list = parser.bufferCache
  const oldOffset = parser.offset
  var chunks = list.length
  var offset = parser.bigStrSize - parser.totalChunkSize
  parser.offset = offset
  if (offset <= 2) {
    if (chunks === 2) {
      return list[0].toString('utf8', oldOffset, list[0].length + offset - 2)
    }
    chunks--
    offset = list[list.length - 2].length + offset
  }
  var res = decoder.write(list[0].slice(oldOffset))
  for (var i = 1; i < chunks - 1; i++) {
    res += decoder.write(list[i])
  }
  res += decoder.end(list[i].slice(0, offset - 2))
  return res
}
function concatBulkString (parser) {
  const list = parser.bufferCache
  const oldOffset = parser.offset
  var chunks = list.length
  var offset = parser.bigStrSize - parser.totalChunkSize
  parser.offset = offset
  if (offset <= 2) {
    if (chunks === 2) {
      return list[0].toString('utf8', oldOffset, list[0].length + offset - 2)
    }
    chunks--
    offset = list[list.length - 2].length + offset
  }
  var res = decoder.write(list[0].slice(oldOffset))
  for (var i = 1; i < chunks - 1; i++) {
    res += decoder.write(list[i])
  }
  res += decoder.end(list[i].slice(0, offset - 2))
  return res
}
function concatBulkString ( parser ) { const list = parser . bufferCache const oldOffset = parser . offset var chunks = list . length var offset = parser . bigStrSize - parser . totalChunkSize parser . offset = offset if ( offset <= 2 ) { if ( chunks === 2 ) { return list [ 0 ] . toString ( 'utf8' , oldOffset , list [ 0 ] . length + offset - 2 ) } chunks -- offset = list [ list . length - 2 ] . length + offset } var res = decoder . write ( list [ 0 ] . slice ( oldOffset ) ) for ( var i = 1 ; i < chunks - 1 ; i ++ ) { res += decoder . write ( list [ i ] ) } res += decoder . end ( list [ i ] . slice ( 0 , offset - 2 ) ) return res }
Concat a bulk string containing multiple chunks

Notes:
1) The first chunk might contain the whole bulk string including the \r
2) We are only safe to fully add up elements that are neither the first nor any of the last two elements

@param {JavascriptRedisParser} parser
@returns {String}
Concat a bulk string containing multiple chunks