`ReadableStreamBYOBReader.readAtLeast(minBytes, bufferArrayBufferView)` as per https://developers.cl

ReadableStreamBYOBReader.readAtLeast(minBytes, bufferArrayBufferView) as per
https://developers.cloudflare.com/workers/runtime-apis/streams/readablestreambyobreader/#methods says:
Returns a promise with the next available chunk of data read into a passed-in buffer. The promise will not resolve until at least minBytes have been read.

What happens if the source stream ends with less than minBytes available? A little bit of sanity would say that it would resolve with the buffer partially filled with the available bytes, rather than rejecting, but that contradicts the absolute statement "The promise will not resolve until at least minBytes have been read". Can someone confirm and perhaps update the docs?
Was this page helpful?