From c641efbd0a95011f832d8439c7f43ddb83397989 Mon Sep 17 00:00:00 2001 From: evilmanimani Date: Sun, 24 Apr 2022 14:55:50 -0700 Subject: [PATCH] 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. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d23bbeb..2aae214 100644 --- a/README.md +++ b/README.md @@ -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"}); ```