mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
PR-URL: https://github.com/nodejs/node/pull/25321 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
13 lines
226 B
JavaScript
13 lines
226 B
JavaScript
'use strict';
|
|
|
|
function readableStreamFromArray(array) {
|
|
return new ReadableStream({
|
|
start(controller) {
|
|
for (let entry of array) {
|
|
controller.enqueue(entry);
|
|
}
|
|
controller.close();
|
|
}
|
|
});
|
|
}
|