@zip.js/zip.js 2.18.0 → 2.18.2
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/deno.json +1 -1
- package/dist/zip-core-external.js +33 -33
- package/dist/zip-core-external.min.js +1 -1
- package/dist/zip-core.js +33 -33
- package/dist/zip-core.min.js +1 -1
- package/dist/zip-fs-core-external.js +33 -33
- package/dist/zip-fs-core-external.min.js +1 -1
- package/dist/zip-fs-core.js +33 -33
- package/dist/zip-fs-core.min.js +1 -1
- package/dist/zip-fs-external.js +33 -33
- package/dist/zip-fs-external.min.js +1 -1
- package/dist/zip-fs-native.js +33 -33
- package/dist/zip-fs-native.min.js +1 -1
- package/dist/zip-fs.js +33 -33
- package/dist/zip-fs.min.js +1 -1
- package/dist/zip-legacy.js +33 -33
- package/dist/zip-legacy.min.js +1 -1
- package/dist/zip-native.js +33 -33
- package/dist/zip-native.min.js +1 -1
- package/dist/zip.js +33 -33
- package/dist/zip.min.js +1 -1
- package/index-native.cjs +33 -33
- package/index-native.min.js +1 -1
- package/index.cjs +33 -33
- package/index.d.cts +15 -2
- package/index.d.ts +15 -2
- package/index.min.js +1 -1
- package/lib/core/version.js +1 -1
- package/lib/core/zip-reader.js +32 -32
- package/package.json +1 -1
package/deno.json
CHANGED
|
@@ -6038,32 +6038,19 @@ async function detectOverlappingEntry({
|
|
|
6038
6038
|
}) {
|
|
6039
6039
|
let dataDescriptorLength = 0;
|
|
6040
6040
|
if (dataDescriptor) {
|
|
6041
|
-
|
|
6042
|
-
|
|
6043
|
-
} else {
|
|
6044
|
-
dataDescriptorLength = DATA_DESCRIPTOR_RECORD_LENGTH;
|
|
6045
|
-
}
|
|
6046
|
-
}
|
|
6047
|
-
if (dataDescriptorLength) {
|
|
6048
|
-
const dataDescriptorArray = await readUint8Array(reader, dataOffset + compressedSize, dataDescriptorLength + DATA_DESCRIPTOR_RECORD_SIGNATURE_LENGTH);
|
|
6041
|
+
const zip64 = Boolean(extraFieldZip64);
|
|
6042
|
+
const dataDescriptorArray = await readUint8Array(reader, dataOffset + compressedSize, DATA_DESCRIPTOR_RECORD_ZIP_64_LENGTH + DATA_DESCRIPTOR_RECORD_SIGNATURE_LENGTH);
|
|
6049
6043
|
const dataDescriptorView = getDataView(dataDescriptorArray);
|
|
6050
|
-
|
|
6051
|
-
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
|
|
6055
|
-
|
|
6056
|
-
signedDataDescriptor.compressedSize == compressedSize &&
|
|
6057
|
-
signedDataDescriptor.uncompressedSize == uncompressedSize) {
|
|
6058
|
-
dataDescriptorLength += DATA_DESCRIPTOR_RECORD_SIGNATURE_LENGTH;
|
|
6059
|
-
} else {
|
|
6060
|
-
signature = false;
|
|
6061
|
-
}
|
|
6062
|
-
}
|
|
6063
|
-
if (dataDescriptorArray.length >= dataDescriptorLength) {
|
|
6064
|
-
const localDataDescriptor = readDataDescriptor(dataDescriptorView, signature ? DATA_DESCRIPTOR_RECORD_SIGNATURE_LENGTH : 0, extraFieldZip64);
|
|
6065
|
-
localDataDescriptor.signature = signature;
|
|
6044
|
+
const candidates = [[zip64, true], [zip64, false], [!zip64, true], [!zip64, false]]
|
|
6045
|
+
.map(([zip64Layout, signature]) => readDataDescriptor(dataDescriptorView, zip64Layout, signature))
|
|
6046
|
+
.filter(candidate => candidate && candidate.compressedSize == compressedSize && candidate.uncompressedSize == uncompressedSize);
|
|
6047
|
+
const localDataDescriptor = candidates.find(candidate => candidate.crc32 == crc32) || candidates[0] ||
|
|
6048
|
+
readDataDescriptor(dataDescriptorView, zip64, true) || readDataDescriptor(dataDescriptorView, zip64, false);
|
|
6049
|
+
if (localDataDescriptor) {
|
|
6066
6050
|
fileEntry.localDirectory.dataDescriptor = localDataDescriptor;
|
|
6051
|
+
dataDescriptorLength = getDataDescriptorLength(localDataDescriptor.zip64, localDataDescriptor.signature);
|
|
6052
|
+
} else {
|
|
6053
|
+
dataDescriptorLength = getDataDescriptorLength(zip64, false);
|
|
6067
6054
|
}
|
|
6068
6055
|
}
|
|
6069
6056
|
const range = {
|
|
@@ -6128,18 +6115,31 @@ function mergeRanges(sortedRanges, pendingRanges) {
|
|
|
6128
6115
|
return mergedRanges;
|
|
6129
6116
|
}
|
|
6130
6117
|
|
|
6131
|
-
function readDataDescriptor(dataDescriptorView,
|
|
6118
|
+
function readDataDescriptor(dataDescriptorView, zip64, signature) {
|
|
6119
|
+
const offset = signature ? DATA_DESCRIPTOR_RECORD_SIGNATURE_LENGTH : 0;
|
|
6120
|
+
if (dataDescriptorView.byteLength < getDataDescriptorLength(zip64, signature) ||
|
|
6121
|
+
(signature && getUint32$1(dataDescriptorView, 0) != DATA_DESCRIPTOR_RECORD_SIGNATURE)) {
|
|
6122
|
+
return UNDEFINED_VALUE;
|
|
6123
|
+
}
|
|
6132
6124
|
const crc32 = getUint32$1(dataDescriptorView, offset);
|
|
6133
6125
|
let compressedSize;
|
|
6134
6126
|
let uncompressedSize;
|
|
6135
|
-
|
|
6136
|
-
|
|
6137
|
-
|
|
6138
|
-
|
|
6139
|
-
|
|
6140
|
-
|
|
6127
|
+
try {
|
|
6128
|
+
if (zip64) {
|
|
6129
|
+
compressedSize = getBigUint64(dataDescriptorView, offset + 4);
|
|
6130
|
+
uncompressedSize = getBigUint64(dataDescriptorView, offset + 12);
|
|
6131
|
+
} else {
|
|
6132
|
+
compressedSize = getUint32$1(dataDescriptorView, offset + 4);
|
|
6133
|
+
uncompressedSize = getUint32$1(dataDescriptorView, offset + 8);
|
|
6134
|
+
}
|
|
6135
|
+
} catch {
|
|
6136
|
+
return UNDEFINED_VALUE;
|
|
6141
6137
|
}
|
|
6142
|
-
return { crc32, compressedSize, uncompressedSize };
|
|
6138
|
+
return { signature, zip64, crc32, compressedSize, uncompressedSize };
|
|
6139
|
+
}
|
|
6140
|
+
|
|
6141
|
+
function getDataDescriptorLength(zip64, signature) {
|
|
6142
|
+
return (zip64 ? DATA_DESCRIPTOR_RECORD_ZIP_64_LENGTH : DATA_DESCRIPTOR_RECORD_LENGTH) + (signature ? DATA_DESCRIPTOR_RECORD_SIGNATURE_LENGTH : 0);
|
|
6143
6143
|
}
|
|
6144
6144
|
|
|
6145
6145
|
function getDiskOffset$1(reader, diskNumber) {
|
|
@@ -8962,7 +8962,7 @@ function formatSupported(StreamClass, format) {
|
|
|
8962
8962
|
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
8963
8963
|
*/
|
|
8964
8964
|
|
|
8965
|
-
const VERSION = "2.18.
|
|
8965
|
+
const VERSION = "2.18.2";
|
|
8966
8966
|
|
|
8967
8967
|
/*
|
|
8968
8968
|
Copyright (c) 2025 Gildas Lormeau. All rights reserved.
|