summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/encoding/streams/resources/readable-stream-from-array.js
blob: 5c12ba8c8bba60ef52a689abae17d1f1e0bfc458 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
'use strict';

function readableStreamFromArray(array) {
  return new ReadableStream({
    start(controller) {
      for (let entry of array) {
        controller.enqueue(entry);
      }
      controller.close();
   }
  });
}