@zip.js/zip.js 2.7.41 → 2.7.42

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-full.js CHANGED
@@ -7781,9 +7781,10 @@
7781
7781
  commentUTF8,
7782
7782
  rawExtraField: directoryArray.subarray(extraFieldOffset, commentOffset)
7783
7783
  });
7784
+ const decode = getOptionValue$1(zipReader, options, "decodeText") || decodeText;
7784
7785
  const [filename, comment] = await Promise.all([
7785
- decodeText(rawFilename, filenameUTF8 ? CHARSET_UTF8 : filenameEncoding || CHARSET_CP437),
7786
- decodeText(rawComment, commentUTF8 ? CHARSET_UTF8 : commentEncoding || CHARSET_CP437)
7786
+ decode(rawFilename, filenameUTF8 ? CHARSET_UTF8 : filenameEncoding || CHARSET_CP437),
7787
+ decode(rawComment, commentUTF8 ? CHARSET_UTF8 : commentEncoding || CHARSET_CP437)
7787
7788
  ]);
7788
7789
  Object.assign(fileEntry, {
7789
7790
  rawComment,
@@ -8387,12 +8388,13 @@
8387
8388
  } else {
8388
8389
  options.directory = name.endsWith(DIRECTORY_SIGNATURE);
8389
8390
  }
8390
- const rawFilename = encodeText(name);
8391
+ const encode = getOptionValue(zipWriter, options, "encodeText", encodeText);
8392
+ const rawFilename = encode(name);
8391
8393
  if (getLength(rawFilename) > MAX_16_BITS) {
8392
8394
  throw new Error(ERR_INVALID_ENTRY_NAME);
8393
8395
  }
8394
8396
  const comment = options.comment || "";
8395
- const rawComment = encodeText(comment);
8397
+ const rawComment = encode(comment);
8396
8398
  if (getLength(rawComment) > MAX_16_BITS) {
8397
8399
  throw new Error(ERR_INVALID_ENTRY_COMMENT);
8398
8400
  }
@@ -8495,7 +8497,7 @@
8495
8497
  zip64DiskNumberStart,
8496
8498
  password,
8497
8499
  rawPassword,
8498
- level,
8500
+ level: !useCompressionStream && zipWriter.config.CompressionStream === UNDEFINED_VALUE ? 0 : level,
8499
8501
  useWebWorkers,
8500
8502
  encryptionStrength,
8501
8503
  extendedTimestamp,