From 592ed36c323077924662dd7d4db7b36b74fac6d1 Mon Sep 17 00:00:00 2001 From: monster860 Date: Thu, 23 Dec 2021 14:03:34 -0500 Subject: [PATCH] Fix behavior of BlobDataItem.slice() --- from.js | 2 +- test.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/from.js b/from.js index 430b071..477dbfd 100644 --- a/from.js +++ b/from.js @@ -80,7 +80,7 @@ class BlobDataItem { path: this.#path, lastModified: this.lastModified, size: end - start, - start + start: this.#start + start }) } diff --git a/test.js b/test.js index a2968fc..e913734 100644 --- a/test.js +++ b/test.js @@ -211,6 +211,7 @@ test('blob part backed up by filesystem', async t => { const blob = blobFromSync('./LICENSE') t.is(await blob.slice(0, 3).text(), license.slice(0, 3)) t.is(await blob.slice(4, 11).text(), license.slice(4, 11)) + t.is(await blob.slice(4, 11).slice(2, 5).text(), license.slice(4, 11).slice(2, 5)) }) test('Reading after modified should fail', async t => {