@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 +1 -1
- package/dist/zip-fs-full.js +7 -5
- package/dist/zip-fs-full.min.js +1 -1
- package/dist/zip-fs.js +7 -5
- package/dist/zip-fs.min.js +1 -1
- package/dist/zip-full.js +7 -5
- package/dist/zip-full.min.js +1 -1
- package/dist/zip-no-worker-deflate.min.js +1 -1
- package/dist/zip-no-worker-inflate.min.js +1 -1
- package/dist/zip-no-worker.min.js +1 -1
- package/dist/zip.js +7 -5
- package/dist/zip.min.js +1 -1
- package/index.cjs +7 -5
- package/index.d.ts +34 -19
- package/index.min.js +1 -1
- package/lib/core/zip-reader.js +3 -2
- package/lib/core/zip-writer.js +4 -3
- package/package.json +1 -1
package/lib/core/zip-reader.js
CHANGED
|
@@ -277,9 +277,10 @@ class ZipReader {
|
|
|
277
277
|
commentUTF8,
|
|
278
278
|
rawExtraField: directoryArray.subarray(extraFieldOffset, commentOffset)
|
|
279
279
|
});
|
|
280
|
+
const decode = getOptionValue(zipReader, options, "decodeText") || decodeText;
|
|
280
281
|
const [filename, comment] = await Promise.all([
|
|
281
|
-
|
|
282
|
-
|
|
282
|
+
decode(rawFilename, filenameUTF8 ? CHARSET_UTF8 : filenameEncoding || CHARSET_CP437),
|
|
283
|
+
decode(rawComment, commentUTF8 ? CHARSET_UTF8 : commentEncoding || CHARSET_CP437)
|
|
283
284
|
]);
|
|
284
285
|
Object.assign(fileEntry, {
|
|
285
286
|
rawComment,
|
package/lib/core/zip-writer.js
CHANGED
|
@@ -224,12 +224,13 @@ async function addFile(zipWriter, name, reader, options) {
|
|
|
224
224
|
} else {
|
|
225
225
|
options.directory = name.endsWith(DIRECTORY_SIGNATURE);
|
|
226
226
|
}
|
|
227
|
-
const
|
|
227
|
+
const encode = getOptionValue(zipWriter, options, "encodeText", encodeText);
|
|
228
|
+
const rawFilename = encode(name);
|
|
228
229
|
if (getLength(rawFilename) > MAX_16_BITS) {
|
|
229
230
|
throw new Error(ERR_INVALID_ENTRY_NAME);
|
|
230
231
|
}
|
|
231
232
|
const comment = options.comment || "";
|
|
232
|
-
const rawComment =
|
|
233
|
+
const rawComment = encode(comment);
|
|
233
234
|
if (getLength(rawComment) > MAX_16_BITS) {
|
|
234
235
|
throw new Error(ERR_INVALID_ENTRY_COMMENT);
|
|
235
236
|
}
|
|
@@ -332,7 +333,7 @@ async function addFile(zipWriter, name, reader, options) {
|
|
|
332
333
|
zip64DiskNumberStart,
|
|
333
334
|
password,
|
|
334
335
|
rawPassword,
|
|
335
|
-
level,
|
|
336
|
+
level: !useCompressionStream && zipWriter.config.CompressionStream === UNDEFINED_VALUE ? 0 : level,
|
|
336
337
|
useWebWorkers,
|
|
337
338
|
encryptionStrength,
|
|
338
339
|
extendedTimestamp,
|
package/package.json
CHANGED