lib/parser.js
function resizeBuffer (length) {
  if (bufferPool.length < length + bufferOffset) {
    const multiplier = length > 1024 * 1024 * 75 ? 2 : 3
    if (bufferOffset > 1024 * 1024 * 111) {
      bufferOffset = 1024 * 1024 * 50
    }
    bufferPool = Buffer.allocUnsafe(length * multiplier + bufferOffset)
    bufferOffset = 0
    counter++
    if (interval === null) {
      interval = setInterval(decreaseBufferPool, 50)
    }
  }
}
function resizeBuffer (length) {
  if (bufferPool.length < length + bufferOffset) {
    const multiplier = length > 1024 * 1024 * 75 ? 2 : 3
    if (bufferOffset > 1024 * 1024 * 111) {
      bufferOffset = 1024 * 1024 * 50
    }
    bufferPool = Buffer.allocUnsafe(length * multiplier + bufferOffset)
    bufferOffset = 0
    counter++
    if (interval === null) {
      interval = setInterval(decreaseBufferPool, 50)
    }
  }
}
function resizeBuffer ( length ) { if ( bufferPool . length < length + bufferOffset ) { const multiplier = length > 1024 * 1024 * 75 ? 2 : 3 if ( bufferOffset > 1024 * 1024 * 111 ) { bufferOffset = 1024 * 1024 * 50 } bufferPool = Buffer . allocUnsafe ( length * multiplier + bufferOffset ) bufferOffset = 0 counter ++ if ( interval === null ) { interval = setInterval ( decreaseBufferPool , 50 ) } } }
Check if the requested size fits in the current bufferPool.
If it does not, reset and increase the bufferPool accordingly.

@param {number} length
@returns {undefined}
Check if the requested size fits in the current bufferPool . If it does not reset and increase the bufferPool accordingly .