@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.
@@ -6061,19 +6061,11 @@ async function detectOverlappingEntry({
6061
6061
  const zip64 = Boolean(extraFieldZip64);
6062
6062
  const dataDescriptorArray = await readUint8Array(reader, dataOffset + compressedSize, DATA_DESCRIPTOR_RECORD_ZIP_64_LENGTH + DATA_DESCRIPTOR_RECORD_SIGNATURE_LENGTH);
6063
6063
  const dataDescriptorView = getDataView(dataDescriptorArray);
6064
- const ignoreCrc32 = fileEntry.encrypted && !fileEntry.zipCrypto;
6065
- let localDataDescriptor;
6066
- for (const [zip64Layout, signature] of [[zip64, true], [zip64, false], [!zip64, true], [!zip64, false]]) {
6067
- const candidate = readDataDescriptor(dataDescriptorView, zip64Layout, signature);
6068
- if (candidate && (ignoreCrc32 || candidate.crc32 == crc32) &&
6069
- candidate.compressedSize == compressedSize && candidate.uncompressedSize == uncompressedSize) {
6070
- localDataDescriptor = candidate;
6071
- break;
6072
- }
6073
- }
6074
- if (!localDataDescriptor) {
6075
- localDataDescriptor = readDataDescriptor(dataDescriptorView, zip64, false);
6076
- }
6064
+ const candidates = [[zip64, true], [zip64, false], [!zip64, true], [!zip64, false]]
6065
+ .map(([zip64Layout, signature]) => readDataDescriptor(dataDescriptorView, zip64Layout, signature))
6066
+ .filter(candidate => candidate && candidate.compressedSize == compressedSize && candidate.uncompressedSize == uncompressedSize);
6067
+ const localDataDescriptor = candidates.find(candidate => candidate.crc32 == crc32) || candidates[0] ||
6068
+ readDataDescriptor(dataDescriptorView, zip64, true) || readDataDescriptor(dataDescriptorView, zip64, false);
6077
6069
  if (localDataDescriptor) {
6078
6070
  fileEntry.localDirectory.dataDescriptor = localDataDescriptor;
6079
6071
  dataDescriptorLength = getDataDescriptorLength(localDataDescriptor.zip64, localDataDescriptor.signature);
@@ -9088,7 +9080,7 @@ function formatSupported(StreamClass, format) {
9088
9080
  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9089
9081
  */
9090
9082
 
9091
- const VERSION = "2.18.1";
9083
+ const VERSION = "2.18.2";
9092
9084
 
9093
9085
  /*
9094
9086
  Copyright (c) 2025 Gildas Lormeau. All rights reserved.