rdfjs / N3.js

Lightning fast, spec-compatible, streaming RDF for JavaScript
http://rdf.js.org/N3.js/
Other
676 stars 127 forks source link

fix: added buffer dependency #387

Closed bergos closed 2 weeks ago

bergos commented 2 weeks ago

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.

github-actions[bot] commented 2 weeks ago

:tada: This PR is included in version 1.17.4 :tada:

The release is available on:

Your semantic-release bot :package::rocket: