@zip.js/zip.js 2.18.1 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zip-js/zip-js",
3
- "version": "2.18.1",
3
+ "version": "2.18.2",
4
4
  "exports": {
5
5
  ".": "./index.js",
6
6
  "./external": "./lib/zip-fs-external.js",
@@ -6041,19 +6041,11 @@ async function detectOverlappingEntry({
6041
6041
  const zip64 = Boolean(extraFieldZip64);
6042
6042
  const dataDescriptorArray = await readUint8Array(reader, dataOffset + compressedSize, DATA_DESCRIPTOR_RECORD_ZIP_64_LENGTH + DATA_DESCRIPTOR_RECORD_SIGNATURE_LENGTH);
6043
6043
  const dataDescriptorView = getDataView(dataDescriptorArray);
6044
- const ignoreCrc32 = fileEntry.encrypted && !fileEntry.zipCrypto;
6045
- let localDataDescriptor;
6046
- for (const [zip64Layout, signature] of [[zip64, true], [zip64, false], [!zip64, true], [!zip64, false]]) {
6047
- const candidate = readDataDescriptor(dataDescriptorView, zip64Layout, signature);
6048
- if (candidate && (ignoreCrc32 || candidate.crc32 == crc32) &&
6049
- candidate.compressedSize == compressedSize && candidate.uncompressedSize == uncompressedSize) {
6050
- localDataDescriptor = candidate;
6051
- break;
6052
- }
6053
- }
6054
- if (!localDataDescriptor) {
6055
- localDataDescriptor = readDataDescriptor(dataDescriptorView, zip64, false);
6056
- }
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);
6057
6049
  if (localDataDescriptor) {
6058
6050
  fileEntry.localDirectory.dataDescriptor = localDataDescriptor;
6059
6051
  dataDescriptorLength = getDataDescriptorLength(localDataDescriptor.zip64, localDataDescriptor.signature);
@@ -8970,7 +8962,7 @@ function formatSupported(StreamClass, format) {
8970
8962
  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8971
8963
  */
8972
8964
 
8973
- const VERSION = "2.18.1";
8965
+ const VERSION = "2.18.2";
8974
8966
 
8975
8967
  /*
8976
8968
  Copyright (c) 2025 Gildas Lormeau. All rights reserved.