Fixed 'ReadableStream' function example.

The function as it is written doesn't work, replaced reference to 'arr' with 'buffers' and added '{type: "array"}' to XLSX.read arguments.
This commit is contained in:
evilmanimani 2022-04-24 14:55:50 -07:00 committed by GitHub
parent 8124fcbae0
commit c641efbd0a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1075,7 +1075,7 @@ async function process_RS(stream) {
const out = new Uint8Array(buffers.reduce((acc, v) => acc + v.length, 0));
let off = 0;
for(const u8 of arr) {
for(const u8 of buffers) {
out.set(u8, off);
off += u8.length;
}
@ -1085,7 +1085,7 @@ async function process_RS(stream) {
const data = await process_RS(stream);
/* data is Uint8Array */
const workbook = XLSX.read(data);
const workbook = XLSX.read(data, {type: "array"});
```
</details>