Files
Kmake/test/fixtures/wpt/encoding/streams/resources/readable-stream-to-array.js
2026-05-26 23:36:42 -07:00

12 lines
222 B
JavaScript

'use strict';
function readableStreamToArray(stream) {
var array = [];
var writable = new WritableStream({
write(chunk) {
array.push(chunk);
}
});
return stream.pipeTo(writable).then(() => array);
}