12 lines
226 B
JavaScript
12 lines
226 B
JavaScript
'use strict';
|
|
|
|
function readableStreamFromArray(array) {
|
|
return new ReadableStream({
|
|
start(controller) {
|
|
for (let entry of array) {
|
|
controller.enqueue(entry);
|
|
}
|
|
controller.close();
|
|
}
|
|
});
|
|
}
|