@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/deno.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@zip-js/zip-js",
3
- "version": "2.7.40",
3
+ "version": "2.7.41",
4
4
  "exports": "./index.js"
5
5
  }
@@ -9412,9 +9412,10 @@
9412
9412
  commentUTF8,
9413
9413
  rawExtraField: directoryArray.subarray(extraFieldOffset, commentOffset)
9414
9414
  });
9415
+ const decode = getOptionValue$1(zipReader, options, "decodeText") || decodeText;
9415
9416
  const [filename, comment] = await Promise.all([
9416
- decodeText(rawFilename, filenameUTF8 ? CHARSET_UTF8 : filenameEncoding || CHARSET_CP437),
9417
- decodeText(rawComment, commentUTF8 ? CHARSET_UTF8 : commentEncoding || CHARSET_CP437)
9417
+ decode(rawFilename, filenameUTF8 ? CHARSET_UTF8 : filenameEncoding || CHARSET_CP437),
9418
+ decode(rawComment, commentUTF8 ? CHARSET_UTF8 : commentEncoding || CHARSET_CP437)
9418
9419
  ]);
9419
9420
  Object.assign(fileEntry, {
9420
9421
  rawComment,
@@ -10018,12 +10019,13 @@
10018
10019
  } else {
10019
10020
  options.directory = name.endsWith(DIRECTORY_SIGNATURE);
10020
10021
  }
10021
- const rawFilename = encodeText(name);
10022
+ const encode = getOptionValue(zipWriter, options, "encodeText", encodeText);
10023
+ const rawFilename = encode(name);
10022
10024
  if (getLength(rawFilename) > MAX_16_BITS) {
10023
10025
  throw new Error(ERR_INVALID_ENTRY_NAME);
10024
10026
  }
10025
10027
  const comment = options.comment || "";
10026
- const rawComment = encodeText(comment);
10028
+ const rawComment = encode(comment);
10027
10029
  if (getLength(rawComment) > MAX_16_BITS) {
10028
10030
  throw new Error(ERR_INVALID_ENTRY_COMMENT);
10029
10031
  }
@@ -10126,7 +10128,7 @@
10126
10128
  zip64DiskNumberStart,
10127
10129
  password,
10128
10130
  rawPassword,
10129
- level,
10131
+ level: !useCompressionStream && zipWriter.config.CompressionStream === UNDEFINED_VALUE ? 0 : level,
10130
10132
  useWebWorkers,
10131
10133
  encryptionStrength,
10132
10134
  extendedTimestamp,