@zip.js/zip.js 2.7.13 → 2.7.15
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/zip-fs-full.js +22 -12
- package/dist/zip-fs-full.min.js +1 -1
- package/dist/zip-fs.js +22 -12
- package/dist/zip-fs.min.js +1 -1
- package/dist/zip-full.js +1 -1
- package/dist/zip-full.min.js +1 -1
- package/dist/zip-no-worker-deflate.min.js +1 -1
- package/dist/zip-no-worker-inflate.min.js +1 -1
- package/dist/zip-no-worker.min.js +1 -1
- package/dist/zip.js +1 -1
- package/dist/zip.min.js +1 -1
- package/index.cjs +22 -12
- package/lib/core/io.js +1 -1
- package/lib/core/zip-fs-core.js +21 -11
- package/package.json +1 -1
package/dist/zip-fs-full.js
CHANGED
|
@@ -8029,7 +8029,7 @@
|
|
|
8029
8029
|
reject(request.status == 416 ? new Error(ERR_HTTP_RANGE) : new Error(ERR_HTTP_STATUS + (request.statusText || request.status)));
|
|
8030
8030
|
}
|
|
8031
8031
|
}, false);
|
|
8032
|
-
request.addEventListener("error", event => reject(event.detail.error), false);
|
|
8032
|
+
request.addEventListener("error", event => reject(event.detail ? event.detail.error : new Error("Network error")), false);
|
|
8033
8033
|
request.open(method, url);
|
|
8034
8034
|
if (headers) {
|
|
8035
8035
|
for (const entry of Object.entries(headers)) {
|
|
@@ -10135,7 +10135,7 @@
|
|
|
10135
10135
|
id: fs.entries.length,
|
|
10136
10136
|
parent,
|
|
10137
10137
|
children: [],
|
|
10138
|
-
uncompressedSize: 0
|
|
10138
|
+
uncompressedSize: params.uncompressedSize || 0
|
|
10139
10139
|
});
|
|
10140
10140
|
fs.entries.push(zipEntry);
|
|
10141
10141
|
if (parent) {
|
|
@@ -10332,7 +10332,8 @@
|
|
|
10332
10332
|
data: text,
|
|
10333
10333
|
Reader: TextReader,
|
|
10334
10334
|
Writer: TextWriter,
|
|
10335
|
-
options
|
|
10335
|
+
options,
|
|
10336
|
+
uncompressedSize: text.length
|
|
10336
10337
|
});
|
|
10337
10338
|
}
|
|
10338
10339
|
|
|
@@ -10341,16 +10342,23 @@
|
|
|
10341
10342
|
data: blob,
|
|
10342
10343
|
Reader: BlobReader,
|
|
10343
10344
|
Writer: BlobWriter,
|
|
10344
|
-
options
|
|
10345
|
+
options,
|
|
10346
|
+
uncompressedSize: blob.size
|
|
10345
10347
|
});
|
|
10346
10348
|
}
|
|
10347
10349
|
|
|
10348
10350
|
addData64URI(name, dataURI, options = {}) {
|
|
10351
|
+
let dataEnd = dataURI.length;
|
|
10352
|
+
while (dataURI.charAt(dataEnd - 1) == "=") {
|
|
10353
|
+
dataEnd--;
|
|
10354
|
+
}
|
|
10355
|
+
const dataStart = dataURI.indexOf(",") + 1;
|
|
10349
10356
|
return addChild(this, name, {
|
|
10350
10357
|
data: dataURI,
|
|
10351
10358
|
Reader: Data64URIReader,
|
|
10352
10359
|
Writer: Data64URIWriter,
|
|
10353
|
-
options
|
|
10360
|
+
options,
|
|
10361
|
+
uncompressedSize: Math.floor((dataEnd - dataStart) * 0.75)
|
|
10354
10362
|
});
|
|
10355
10363
|
}
|
|
10356
10364
|
|
|
@@ -10359,7 +10367,8 @@
|
|
|
10359
10367
|
data: array,
|
|
10360
10368
|
Reader: Uint8ArrayReader,
|
|
10361
10369
|
Writer: Uint8ArrayWriter,
|
|
10362
|
-
options
|
|
10370
|
+
options,
|
|
10371
|
+
uncompressedSize: array.length
|
|
10363
10372
|
});
|
|
10364
10373
|
}
|
|
10365
10374
|
|
|
@@ -10401,7 +10410,8 @@
|
|
|
10401
10410
|
const size = file.size;
|
|
10402
10411
|
return { readable, size };
|
|
10403
10412
|
},
|
|
10404
|
-
options
|
|
10413
|
+
options,
|
|
10414
|
+
uncompressedSize: file.size
|
|
10405
10415
|
});
|
|
10406
10416
|
}
|
|
10407
10417
|
|
|
@@ -10467,7 +10477,8 @@
|
|
|
10467
10477
|
if (!entry.directory) {
|
|
10468
10478
|
importedEntries.push(addChild(parent, name, {
|
|
10469
10479
|
data: entry,
|
|
10470
|
-
Reader: getZipBlobReader(Object.assign({}, options))
|
|
10480
|
+
Reader: getZipBlobReader(Object.assign({}, options)),
|
|
10481
|
+
uncompressedSize: entry.uncompressedSize
|
|
10471
10482
|
}));
|
|
10472
10483
|
}
|
|
10473
10484
|
} catch (error) {
|
|
@@ -10820,10 +10831,9 @@
|
|
|
10820
10831
|
const size = file.size;
|
|
10821
10832
|
return { readable, size };
|
|
10822
10833
|
},
|
|
10823
|
-
options: {
|
|
10824
|
-
|
|
10825
|
-
|
|
10826
|
-
}, options)
|
|
10834
|
+
options: Object.assign({}, { lastModDate: new Date(file.lastModified) }, options),
|
|
10835
|
+
uncompressedSize: file.size
|
|
10836
|
+
})
|
|
10827
10837
|
);
|
|
10828
10838
|
} else if (handle.kind == "directory") {
|
|
10829
10839
|
const directoryEntry = parentEntry.addDirectory(handle.name);
|