@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-fs.js CHANGED
@@ -6036,19 +6036,11 @@
6036
6036
  const zip64 = Boolean(extraFieldZip64);
6037
6037
  const dataDescriptorArray = await readUint8Array(reader, dataOffset + compressedSize, DATA_DESCRIPTOR_RECORD_ZIP_64_LENGTH + DATA_DESCRIPTOR_RECORD_SIGNATURE_LENGTH);
6038
6038
  const dataDescriptorView = getDataView(dataDescriptorArray);
6039
- const ignoreCrc32 = fileEntry.encrypted && !fileEntry.zipCrypto;
6040
- let localDataDescriptor;
6041
- for (const [zip64Layout, signature] of [[zip64, true], [zip64, false], [!zip64, true], [!zip64, false]]) {
6042
- const candidate = readDataDescriptor(dataDescriptorView, zip64Layout, signature);
6043
- if (candidate && (ignoreCrc32 || candidate.crc32 == crc32) &&
6044
- candidate.compressedSize == compressedSize && candidate.uncompressedSize == uncompressedSize) {
6045
- localDataDescriptor = candidate;
6046
- break;
6047
- }
6048
- }
6049
- if (!localDataDescriptor) {
6050
- localDataDescriptor = readDataDescriptor(dataDescriptorView, zip64, false);
6051
- }
6039
+ const candidates = [[zip64, true], [zip64, false], [!zip64, true], [!zip64, false]]
6040
+ .map(([zip64Layout, signature]) => readDataDescriptor(dataDescriptorView, zip64Layout, signature))
6041
+ .filter(candidate => candidate && candidate.compressedSize == compressedSize && candidate.uncompressedSize == uncompressedSize);
6042
+ const localDataDescriptor = candidates.find(candidate => candidate.crc32 == crc32) || candidates[0] ||
6043
+ readDataDescriptor(dataDescriptorView, zip64, true) || readDataDescriptor(dataDescriptorView, zip64, false);
6052
6044
  if (localDataDescriptor) {
6053
6045
  fileEntry.localDirectory.dataDescriptor = localDataDescriptor;
6054
6046
  dataDescriptorLength = getDataDescriptorLength(localDataDescriptor.zip64, localDataDescriptor.signature);
@@ -9063,7 +9055,7 @@
9063
9055
  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
9064
9056
  */
9065
9057
 
9066
- const VERSION = "2.18.1";
9058
+ const VERSION = "2.18.2";
9067
9059
 
9068
9060
  /*
9069
9061
  Copyright (c) 2025 Gildas Lormeau. All rights reserved.