cloudworker-proxy
Version:
An api gateway for cloudflare workers
21 lines (17 loc) • 309 B
JavaScript
/**
* Reads a content from given ReadableStream
*
* @yield {any}
*
* @api private
*/
async function* readableStreamIterator(reader) {
while (true) {
const {done, value} = await reader.read()
if (done) {
return value
}
yield value
}
}
module.exports = readableStreamIterator