I found one line in the code where Buffer is used. Buffer is only in Node.js environments a global object and not available in the browser. Most of the time, this is probably not a problem because readable-stream imports the package, but in the wrong order, this may cause problems. I stumbled over this after reading the discussion of recently opened issue.
This PR adds buffer as a dependency and adds an import in the file where Buffer.concat() is used. In browser environments, nothing changes. It only makes the usage of buffer explicit. In Node.js or other compatible environments, the implementation of Buffer.concat() will be a different one, but the package is from a trusted author, it is performance optimized, and it's already used by the nested dependency readable-stream.
I found one line in the code where
Buffer
is used.Buffer
is only in Node.js environments a global object and not available in the browser. Most of the time, this is probably not a problem becausereadable-stream
imports the package, but in the wrong order, this may cause problems. I stumbled over this after reading the discussion of recently opened issue.This PR adds
buffer
as a dependency and adds an import in the file whereBuffer.concat()
is used. In browser environments, nothing changes. It only makes the usage ofbuffer
explicit. In Node.js or other compatible environments, the implementation ofBuffer.concat()
will be a different one, but the package is from a trusted author, it is performance optimized, and it's already used by the nested dependencyreadable-stream
.