Sec-ant / readable-stream

A tiny, zero-dependency yet spec-compliant asynchronous iterator polyfill/ponyfill for ReadableStreams.
https://www.npmjs.com/package/@sec-ant/readable-stream/v/latest
MIT License
7 stars 4 forks source link

Why is highWaterMark set to 0 for `fromAnyIterable` #32

Closed wong2 closed 1 month ago

wong2 commented 1 month ago

What is the reason behind this decision?

Sec-ant commented 1 month ago

Actually, I forgot, probably trying to pass some of the test cases. Welcome to contribute if this is misimplemented.

wong2 commented 1 month ago

I found that this is actually consistent with Node.js's ReadableStream.from implementation, so it should be fine: https://github.com/nodejs/node/blob/cad73dadba005ddb5b1d810e0bfbcd7034b94e35/lib/internal/webstreams/readablestream.js#L1352