Skip to content

Commit 48dfe23

Browse files
committed
New release
1 parent 5e3b623 commit 48dfe23

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,12 @@ async function fetchInChunks(url, options = {}) {
9898
while (start < fileSize) {
9999
if (queue.length < maxParallelRequests) {
100100
let end = Math.min(start + chunkSize - 1, fileSize - 1);
101-
let actualStart = start; // Preserve the actual start value
101+
// Preserve the actual start value.
102+
let actualStart = start;
102103
let promise = fetchChunk(url, start, end, signal)
103104
.then((chunk) => {
104-
chunks.push({ start: actualStart, chunk }); // Use preserved start value
105+
// Use preserved start value.
106+
chunks.push({ start: actualStart, chunk });
105107
downloadedBytes += chunk.byteLength;
106108

107109
if (progressCallback) {

package-lock.json

Lines changed: 7 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fetch-in-chunks",
3-
"version": "1.2.1",
3+
"version": "1.3.0",
44
"description": "A utility for fetching large files in chunks with support for parallel downloads and progress tracking.",
55
"main": "index.js",
66
"types": "index.d.ts",
@@ -41,7 +41,7 @@
4141
"homepage": "https://github.com/tomayac/fetch-in-chunks#readme",
4242
"devDependencies": {
4343
"http-server": "^14.1.1",
44-
"prettier": "^3.3.2",
44+
"prettier": "^3.3.3",
4545
"prettier-plugin-jsdoc": "^1.3.0"
4646
}
4747
}

0 commit comments

Comments
 (0)