sindresorhus / get-stream

Get a stream as a string, Buffer, ArrayBuffer or array
MIT License
341 stars 33 forks source link

Allow `maxBuffer` option to be set to Buffer `MAX_LENGTH` #40

Closed gpoole closed 4 years ago

gpoole commented 4 years ago

This change allows passing Buffer's MAX_LENGTH constant as the maxBuffer option (or values larger than MAX_LENGTH). Fixes a bug where other errors would be hidden by a RangeError (e.g. "RangeError: "size" argument must not be larger than 2147483647") when the error handling code tried to call getBufferedValue while buffering a stream larger than Buffer's MAX_LENGTH.