Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 | 1x 1x 2x 2x 2x 5x 5x 3x 2x | import {listToUint8} from '@jsonjoy.com/buffers/lib/concat';
export const fromStream = async (stream: ReadableStream<Uint8Array>): Promise<Uint8Array> => {
const reader = stream.getReader();
const chunks: Uint8Array[] = [];
while (true) {
const {done, value} = await reader.read();
if (done) break;
chunks.push(value);
}
return listToUint8(chunks);
};
|