glitch-javascript-sdk 0.7.9 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +4 -4
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +4 -4
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
- package/src/util/Requests.ts +3 -3
package/dist/cjs/index.js
CHANGED
|
@@ -18653,7 +18653,7 @@ var Requests = /** @class */ (function () {
|
|
|
18653
18653
|
identifier = Array.from(array, function (dec) { return ('0' + dec.toString(16)).substr(-2); }).join('');
|
|
18654
18654
|
_a.label = 1;
|
|
18655
18655
|
case 1:
|
|
18656
|
-
if (!(currentChunkIndex
|
|
18656
|
+
if (!(currentChunkIndex <= totalChunks)) return [3 /*break*/, 3];
|
|
18657
18657
|
start = currentChunkIndex * chunkSize;
|
|
18658
18658
|
end = Math.min(start + chunkSize, fileSize);
|
|
18659
18659
|
chunk = file.slice(start, end);
|
|
@@ -18677,11 +18677,11 @@ var Requests = /** @class */ (function () {
|
|
|
18677
18677
|
return [4 /*yield*/, axios$1.post(fullUploadUrl, formData, {
|
|
18678
18678
|
headers: headers,
|
|
18679
18679
|
onUploadProgress: function (progressEvent) {
|
|
18680
|
-
|
|
18680
|
+
progressEvent.loaded; // Bytes uploaded of the current chunk
|
|
18681
18681
|
// Calculate the total uploaded size including previous chunks and the current chunk's progress
|
|
18682
|
-
|
|
18682
|
+
totalUploaded += chunkSize || 1024 * 1024;
|
|
18683
18683
|
if (onProgress) {
|
|
18684
|
-
onProgress(fileSize,
|
|
18684
|
+
onProgress(fileSize, totalUploaded);
|
|
18685
18685
|
}
|
|
18686
18686
|
}
|
|
18687
18687
|
})];
|