From ae6b565ae64601fd3ab4892d3621d17ba366a216 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jimmy=20Wa=CC=88rting?= Date: Fri, 24 Jul 2020 01:52:36 +0200 Subject: [PATCH] fix slice test `added` bytes was calculated wrong --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index a6954ce..65331aa 100644 --- a/index.js +++ b/index.js @@ -138,7 +138,7 @@ class Blob { } else { const chunk = part.slice(relativeStart, Math.min(size, relativeEnd)); blobParts.push(chunk); - added += size; + added += ArrayBuffer.isView(chunk) ? chunk.byteLength : chunk.size; relativeStart = 0; // All next sequental parts should start at 0 // don't add the overflow to new blobParts