nodejs / readable-stream

Node-core streams for userland
https://nodejs.org/api/stream.html
Other
1.03k stars 227 forks source link

fix: remove reference to global (browser support) #464

Closed tgambet closed 2 years ago

tgambet commented 2 years ago

Description

This simple PR is about making readable-stream compatible with browsers without needing a global polyfill.

Fixes #426

Discussion

Since global objects are available everywhere, I believe that global.Uint8Array can be safely replaced by Uint8Array. This fixes some issues with browser support, particularly when using this library in a Web worker, or when shimming global is not possible.

baybal commented 2 years ago

@jimmywarting is the fix being merged?