@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/dist/zip.js CHANGED
@@ -6016,19 +6016,11 @@
6016
6016
  const zip64 = Boolean(extraFieldZip64);
6017
6017
  const dataDescriptorArray = await readUint8Array(reader, dataOffset + compressedSize, DATA_DESCRIPTOR_RECORD_ZIP_64_LENGTH + DATA_DESCRIPTOR_RECORD_SIGNATURE_LENGTH);
6018
6018
  const dataDescriptorView = getDataView(dataDescriptorArray);
6019
- const ignoreCrc32 = fileEntry.encrypted && !fileEntry.zipCrypto;
6020
- let localDataDescriptor;
6021
- for (const [zip64Layout, signature] of [[zip64, true], [zip64, false], [!zip64, true], [!zip64, false]]) {
6022
- const candidate = readDataDescriptor(dataDescriptorView, zip64Layout, signature);
6023
- if (candidate && (ignoreCrc32 || candidate.crc32 == crc32) &&
6024
- candidate.compressedSize == compressedSize && candidate.uncompressedSize == uncompressedSize) {
6025
- localDataDescriptor = candidate;
6026
- break;
6027
- }
6028
- }
6029
- if (!localDataDescriptor) {
6030
- localDataDescriptor = readDataDescriptor(dataDescriptorView, zip64, false);
6031
- }
6019
+ const candidates = [[zip64, true], [zip64, false], [!zip64, true], [!zip64, false]]
6020
+ .map(([zip64Layout, signature]) => readDataDescriptor(dataDescriptorView, zip64Layout, signature))
6021
+ .filter(candidate => candidate && candidate.compressedSize == compressedSize && candidate.uncompressedSize == uncompressedSize);
6022
+ const localDataDescriptor = candidates.find(candidate => candidate.crc32 == crc32) || candidates[0] ||
6023
+ readDataDescriptor(dataDescriptorView, zip64, true) || readDataDescriptor(dataDescriptorView, zip64, false);
6032
6024
  if (localDataDescriptor) {
6033
6025
  fileEntry.localDirectory.dataDescriptor = localDataDescriptor;
6034
6026
  dataDescriptorLength = getDataDescriptorLength(localDataDescriptor.zip64, localDataDescriptor.signature);
@@ -8945,7 +8937,7 @@
8945
8937
  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
8946
8938
  */
8947
8939
 
8948
- const VERSION = "2.18.1";
8940
+ const VERSION = "2.18.2";
8949
8941
 
8950
8942
  /*
8951
8943
  Copyright (c) 2025 Gildas Lormeau. All rights reserved.