@zip.js/zip.js 2.7.54 → 2.7.56
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 +89 -56
- package/dist/zip-fs-full.min.js +1 -1
- package/dist/zip-fs.js +89 -48
- package/dist/zip-fs.min.js +1 -1
- package/dist/zip-full.js +81 -51
- 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 +81 -43
- package/dist/zip.min.js +1 -1
- package/eslint.config.mjs +44 -0
- package/index.cjs +89 -56
- package/index.d.ts +21 -4
- package/index.min.js +1 -1
- package/lib/core/codec-pool.js +2 -1
- package/lib/core/codec-worker.js +10 -5
- package/lib/core/configuration.js +2 -1
- package/lib/core/constants.js +4 -0
- package/lib/core/streams/aes-crypto-stream.js +4 -2
- package/lib/core/streams/codecs/deflate.js +0 -4
- package/lib/core/streams/codecs/inflate.js +0 -4
- package/lib/core/streams/zip-entry-stream.js +4 -2
- package/lib/core/z-worker-core.js +4 -2
- package/lib/core/zip-entry.js +5 -4
- package/lib/core/zip-fs-core.js +8 -5
- package/lib/core/zip-reader.js +27 -11
- package/lib/core/zip-writer.js +30 -17
- package/lib/zip-data-uri.js +2 -1
- package/lib/zip-fs.js +2 -1
- package/lib/zip-full-fflate.js +2 -1
- package/lib/zip-full.js +2 -1
- package/lib/zip.js +2 -1
- package/package.json +87 -84
package/dist/zip-full.js
CHANGED
|
@@ -1246,7 +1246,6 @@
|
|
|
1246
1246
|
}
|
|
1247
1247
|
|
|
1248
1248
|
// Copy as much as possible from input to output:
|
|
1249
|
-
// eslint-disable-next-line no-constant-condition
|
|
1250
1249
|
while (true) {
|
|
1251
1250
|
// Fill the win as much as possible:
|
|
1252
1251
|
if (lookahead <= 1) {
|
|
@@ -1341,7 +1340,6 @@
|
|
|
1341
1340
|
|
|
1342
1341
|
// We check for insufficient lookahead only every 8th comparison;
|
|
1343
1342
|
// the 256th check will be made at strstart+258.
|
|
1344
|
-
// eslint-disable-next-line no-empty
|
|
1345
1343
|
do {
|
|
1346
1344
|
// empty block
|
|
1347
1345
|
} while (win[++scan] == win[++match] && win[++scan] == win[++match] && win[++scan] == win[++match]
|
|
@@ -1377,7 +1375,6 @@
|
|
|
1377
1375
|
let hash_head = 0; // head of the hash chain
|
|
1378
1376
|
let bflush; // set if current block must be flushed
|
|
1379
1377
|
|
|
1380
|
-
// eslint-disable-next-line no-constant-condition
|
|
1381
1378
|
while (true) {
|
|
1382
1379
|
// Make sure that we always have enough lookahead, except
|
|
1383
1380
|
// at the end of the input file. We need MAX_MATCH bytes
|
|
@@ -1484,7 +1481,6 @@
|
|
|
1484
1481
|
let max_insert;
|
|
1485
1482
|
|
|
1486
1483
|
// Process the input block.
|
|
1487
|
-
// eslint-disable-next-line no-constant-condition
|
|
1488
1484
|
while (true) {
|
|
1489
1485
|
// Make sure that we always have enough lookahead, except
|
|
1490
1486
|
// at the end of the input file. We need MAX_MATCH bytes
|
|
@@ -2834,7 +2830,6 @@
|
|
|
2834
2830
|
m = q < s.read ? s.read - q - 1 : s.end - q;
|
|
2835
2831
|
|
|
2836
2832
|
// process input and output based on current state
|
|
2837
|
-
// eslint-disable-next-line no-constant-condition
|
|
2838
2833
|
while (true) {
|
|
2839
2834
|
switch (mode) {
|
|
2840
2835
|
// waiting for "i:"=input, "o:"=output, "x:"=nothing
|
|
@@ -3325,7 +3320,6 @@
|
|
|
3325
3320
|
|
|
3326
3321
|
// process input based on current state
|
|
3327
3322
|
// DEBUG dtree
|
|
3328
|
-
// eslint-disable-next-line no-constant-condition
|
|
3329
3323
|
while (true) {
|
|
3330
3324
|
let bl, bd, tl, td, bl_, bd_, tl_, td_;
|
|
3331
3325
|
switch (mode) {
|
|
@@ -3602,7 +3596,6 @@
|
|
|
3602
3596
|
mode = DTREE;
|
|
3603
3597
|
/* falls through */
|
|
3604
3598
|
case DTREE:
|
|
3605
|
-
// eslint-disable-next-line no-constant-condition
|
|
3606
3599
|
while (true) {
|
|
3607
3600
|
t = table;
|
|
3608
3601
|
if (index >= 258 + (t & 0x1f) + ((t >> 5) & 0x1f)) {
|
|
@@ -3910,7 +3903,6 @@
|
|
|
3910
3903
|
const istate = z.istate;
|
|
3911
3904
|
f = f == Z_FINISH ? Z_BUF_ERROR : Z_OK;
|
|
3912
3905
|
r = Z_BUF_ERROR;
|
|
3913
|
-
// eslint-disable-next-line no-constant-condition
|
|
3914
3906
|
while (true) {
|
|
3915
3907
|
switch (istate.mode) {
|
|
3916
3908
|
case METHOD:
|
|
@@ -4290,6 +4282,8 @@
|
|
|
4290
4282
|
const BITFLAG_DATA_DESCRIPTOR = 0x0008;
|
|
4291
4283
|
const BITFLAG_LANG_ENCODING_FLAG = 0x0800;
|
|
4292
4284
|
const FILE_ATTR_MSDOS_DIR_MASK = 0x10;
|
|
4285
|
+
const FILE_ATTR_UNIX_DIR_MASK = 0x4000;
|
|
4286
|
+
const FILE_ATTR_UNIX_EXECUTABLE_MASK = 0o111;
|
|
4293
4287
|
|
|
4294
4288
|
const VERSION_DEFLATE = 0x14;
|
|
4295
4289
|
const VERSION_ZIP64 = 0x2D;
|
|
@@ -4390,7 +4384,8 @@
|
|
|
4390
4384
|
if (typeof navigator != UNDEFINED_TYPE && navigator.hardwareConcurrency) {
|
|
4391
4385
|
maxWorkers = navigator.hardwareConcurrency;
|
|
4392
4386
|
}
|
|
4393
|
-
|
|
4387
|
+
// eslint-disable-next-line no-unused-vars
|
|
4388
|
+
} catch (_) {
|
|
4394
4389
|
// ignored
|
|
4395
4390
|
}
|
|
4396
4391
|
const DEFAULT_CONFIGURATION = {
|
|
@@ -5828,7 +5823,8 @@
|
|
|
5828
5823
|
if (IMPORT_KEY_SUPPORTED) {
|
|
5829
5824
|
try {
|
|
5830
5825
|
return await subtle.importKey(format, password, algorithm, extractable, keyUsages);
|
|
5831
|
-
|
|
5826
|
+
// eslint-disable-next-line no-unused-vars
|
|
5827
|
+
} catch (_) {
|
|
5832
5828
|
IMPORT_KEY_SUPPORTED = false;
|
|
5833
5829
|
return misc.importKey(password);
|
|
5834
5830
|
}
|
|
@@ -5841,7 +5837,8 @@
|
|
|
5841
5837
|
if (DERIVE_BITS_SUPPORTED) {
|
|
5842
5838
|
try {
|
|
5843
5839
|
return await subtle.deriveBits(algorithm, baseKey, length);
|
|
5844
|
-
|
|
5840
|
+
// eslint-disable-next-line no-unused-vars
|
|
5841
|
+
} catch (_) {
|
|
5845
5842
|
DERIVE_BITS_SUPPORTED = false;
|
|
5846
5843
|
return misc.pbkdf2(baseKey, algorithm.salt, DERIVED_BITS_ALGORITHM.iterations, length);
|
|
5847
5844
|
}
|
|
@@ -6159,11 +6156,13 @@
|
|
|
6159
6156
|
try {
|
|
6160
6157
|
const CompressionStream = useCompressionStream && CodecStreamNative ? CodecStreamNative : CodecStream;
|
|
6161
6158
|
readable = pipeThrough(readable, new CompressionStream(COMPRESSION_FORMAT, options));
|
|
6162
|
-
|
|
6159
|
+
// eslint-disable-next-line no-unused-vars
|
|
6160
|
+
} catch (_) {
|
|
6163
6161
|
if (useCompressionStream) {
|
|
6164
6162
|
try {
|
|
6165
6163
|
readable = pipeThrough(readable, new CodecStream(COMPRESSION_FORMAT, options));
|
|
6166
|
-
|
|
6164
|
+
// eslint-disable-next-line no-unused-vars
|
|
6165
|
+
} catch (_) {
|
|
6167
6166
|
return readable;
|
|
6168
6167
|
}
|
|
6169
6168
|
} else {
|
|
@@ -6406,7 +6405,8 @@
|
|
|
6406
6405
|
async function callHandler(handler, ...parameters) {
|
|
6407
6406
|
try {
|
|
6408
6407
|
await handler(...parameters);
|
|
6409
|
-
|
|
6408
|
+
// eslint-disable-next-line no-unused-vars
|
|
6409
|
+
} catch (_) {
|
|
6410
6410
|
// ignored
|
|
6411
6411
|
}
|
|
6412
6412
|
}
|
|
@@ -6423,7 +6423,8 @@
|
|
|
6423
6423
|
let worker;
|
|
6424
6424
|
try {
|
|
6425
6425
|
worker = getWebWorker(workerData.scripts[0], baseURL, workerData);
|
|
6426
|
-
|
|
6426
|
+
// eslint-disable-next-line no-unused-vars
|
|
6427
|
+
} catch (_) {
|
|
6427
6428
|
WEB_WORKERS_SUPPORTED = false;
|
|
6428
6429
|
return createWorkerInterface(workerData, config);
|
|
6429
6430
|
}
|
|
@@ -6526,13 +6527,15 @@
|
|
|
6526
6527
|
}
|
|
6527
6528
|
try {
|
|
6528
6529
|
scriptUrl = new URL(url, baseURL);
|
|
6529
|
-
|
|
6530
|
+
// eslint-disable-next-line no-unused-vars
|
|
6531
|
+
} catch (_) {
|
|
6530
6532
|
scriptUrl = url;
|
|
6531
6533
|
}
|
|
6532
6534
|
if (classicWorkersSupported) {
|
|
6533
6535
|
try {
|
|
6534
6536
|
worker = new Worker(scriptUrl);
|
|
6535
|
-
|
|
6537
|
+
// eslint-disable-next-line no-unused-vars
|
|
6538
|
+
} catch (_) {
|
|
6536
6539
|
classicWorkersSupported = false;
|
|
6537
6540
|
worker = new Worker(scriptUrl, workerOptions);
|
|
6538
6541
|
}
|
|
@@ -6570,7 +6573,8 @@
|
|
|
6570
6573
|
try {
|
|
6571
6574
|
worker.postMessage(message, transferables);
|
|
6572
6575
|
return true;
|
|
6573
|
-
|
|
6576
|
+
// eslint-disable-next-line no-unused-vars
|
|
6577
|
+
} catch (_) {
|
|
6574
6578
|
transferStreamsSupported = false;
|
|
6575
6579
|
message.readable = message.writable = null;
|
|
6576
6580
|
worker.postMessage(message);
|
|
@@ -6713,7 +6717,8 @@
|
|
|
6713
6717
|
pool = pool.filter(data => data != workerData);
|
|
6714
6718
|
try {
|
|
6715
6719
|
await workerData.terminate();
|
|
6716
|
-
|
|
6720
|
+
// eslint-disable-next-line no-unused-vars
|
|
6721
|
+
} catch (_) {
|
|
6717
6722
|
// ignored
|
|
6718
6723
|
}
|
|
6719
6724
|
}, terminateWorkerTimeout);
|
|
@@ -7054,7 +7059,7 @@
|
|
|
7054
7059
|
combineSizeEocd
|
|
7055
7060
|
} = httpReader;
|
|
7056
7061
|
if (isHttpFamily(url) && (useRangeHeader || forceRangeRequests) && (typeof preventHeadRequest == "undefined" || preventHeadRequest)) {
|
|
7057
|
-
const response = await sendRequest(HTTP_METHOD_GET, httpReader, getRangeHeaders(httpReader, combineSizeEocd ? -
|
|
7062
|
+
const response = await sendRequest(HTTP_METHOD_GET, httpReader, getRangeHeaders(httpReader, combineSizeEocd ? -22 : undefined));
|
|
7058
7063
|
if (!forceRangeRequests && response.headers.get(HTTP_HEADER_ACCEPT_RANGES) != HTTP_RANGE_UNIT) {
|
|
7059
7064
|
throw new Error(ERR_HTTP_RANGE);
|
|
7060
7065
|
} else {
|
|
@@ -7577,7 +7582,9 @@
|
|
|
7577
7582
|
const PROPERTY_NAME_CREATION_DATE = "creationDate";
|
|
7578
7583
|
const PROPERTY_NAME_RAW_CREATION_DATE = "rawCreationDate";
|
|
7579
7584
|
const PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTE = "internalFileAttribute";
|
|
7585
|
+
const PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTES = "internalFileAttributes";
|
|
7580
7586
|
const PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTE = "externalFileAttribute";
|
|
7587
|
+
const PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTES = "externalFileAttributes";
|
|
7581
7588
|
const PROPERTY_NAME_MS_DOS_COMPATIBLE = "msDosCompatible";
|
|
7582
7589
|
const PROPERTY_NAME_ZIP64 = "zip64";
|
|
7583
7590
|
const PROPERTY_NAME_ENCRYPTED = "encrypted";
|
|
@@ -7589,10 +7596,7 @@
|
|
|
7589
7596
|
PROPERTY_NAME_FILENAME, PROPERTY_NAME_RAW_FILENAME, PROPERTY_NAME_COMPPRESSED_SIZE, PROPERTY_NAME_UNCOMPPRESSED_SIZE,
|
|
7590
7597
|
PROPERTY_NAME_LAST_MODIFICATION_DATE, PROPERTY_NAME_RAW_LAST_MODIFICATION_DATE, PROPERTY_NAME_COMMENT, PROPERTY_NAME_RAW_COMMENT,
|
|
7591
7598
|
PROPERTY_NAME_LAST_ACCESS_DATE, PROPERTY_NAME_CREATION_DATE, PROPERTY_NAME_OFFSET, PROPERTY_NAME_DISK_NUMBER_START,
|
|
7592
|
-
PROPERTY_NAME_DISK_NUMBER_START, PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTE, PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTE,
|
|
7593
|
-
PROPERTY_NAME_MS_DOS_COMPATIBLE, PROPERTY_NAME_ZIP64, PROPERTY_NAME_ENCRYPTED, PROPERTY_NAME_VERSION, PROPERTY_NAME_VERSION_MADE_BY,
|
|
7594
|
-
PROPERTY_NAME_ZIPCRYPTO, "directory", "bitFlag", "signature", "filenameUTF8", "commentUTF8", "compressionMethod", "extraField", "rawExtraField",
|
|
7595
|
-
"extraFieldZip64", "extraFieldUnicodePath", "extraFieldUnicodeComment", "extraFieldAES", "extraFieldNTFS", "extraFieldExtendedTimestamp"];
|
|
7599
|
+
PROPERTY_NAME_DISK_NUMBER_START, PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTE, PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTES, PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTE, PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTES, PROPERTY_NAME_MS_DOS_COMPATIBLE, PROPERTY_NAME_ZIP64, PROPERTY_NAME_ENCRYPTED, PROPERTY_NAME_VERSION, PROPERTY_NAME_VERSION_MADE_BY, PROPERTY_NAME_ZIPCRYPTO, "directory", "executable", "bitFlag", "signature", "filenameUTF8", "commentUTF8", "compressionMethod", "extraField", "rawExtraField", "extraFieldZip64", "extraFieldUnicodePath", "extraFieldUnicodeComment", "extraFieldAES", "extraFieldNTFS", "extraFieldExtendedTimestamp"];
|
|
7596
7600
|
|
|
7597
7601
|
class Entry {
|
|
7598
7602
|
|
|
@@ -7783,14 +7787,20 @@
|
|
|
7783
7787
|
const extraFieldOffset = filenameOffset + fileEntry.filenameLength;
|
|
7784
7788
|
const commentOffset = extraFieldOffset + fileEntry.extraFieldLength;
|
|
7785
7789
|
const versionMadeBy = getUint16(directoryView, offset + 4);
|
|
7786
|
-
const msDosCompatible =
|
|
7790
|
+
const msDosCompatible = versionMadeBy >> 8 == 0;
|
|
7791
|
+
const unixCompatible = versionMadeBy >> 8 == 3;
|
|
7787
7792
|
const rawFilename = directoryArray.subarray(filenameOffset, extraFieldOffset);
|
|
7788
7793
|
const commentLength = getUint16(directoryView, offset + 32);
|
|
7789
7794
|
const endOffset = commentOffset + commentLength;
|
|
7790
7795
|
const rawComment = directoryArray.subarray(commentOffset, endOffset);
|
|
7791
7796
|
const filenameUTF8 = languageEncodingFlag;
|
|
7792
7797
|
const commentUTF8 = languageEncodingFlag;
|
|
7793
|
-
const
|
|
7798
|
+
const externalFileAttributes = getUint32(directoryView, offset + 38);
|
|
7799
|
+
const directory =
|
|
7800
|
+
(msDosCompatible && ((getUint8(directoryView, offset + 38) & FILE_ATTR_MSDOS_DIR_MASK) == FILE_ATTR_MSDOS_DIR_MASK)) ||
|
|
7801
|
+
(unixCompatible && (((externalFileAttributes >> 16) & FILE_ATTR_UNIX_DIR_MASK) == FILE_ATTR_UNIX_DIR_MASK)) ||
|
|
7802
|
+
(rawFilename.length && rawFilename[rawFilename.length - 1] == DIRECTORY_SIGNATURE.charCodeAt(0));
|
|
7803
|
+
const executable = (unixCompatible && (((externalFileAttributes >> 16) & FILE_ATTR_UNIX_EXECUTABLE_MASK) == FILE_ATTR_UNIX_EXECUTABLE_MASK));
|
|
7794
7804
|
const offsetFileEntry = getUint32(directoryView, offset + 42) + prependedDataLength;
|
|
7795
7805
|
Object.assign(fileEntry, {
|
|
7796
7806
|
versionMadeBy,
|
|
@@ -7801,13 +7811,16 @@
|
|
|
7801
7811
|
directory,
|
|
7802
7812
|
offset: offsetFileEntry,
|
|
7803
7813
|
diskNumberStart: getUint16(directoryView, offset + 34),
|
|
7804
|
-
|
|
7805
|
-
|
|
7814
|
+
internalFileAttributes: getUint16(directoryView, offset + 36),
|
|
7815
|
+
externalFileAttributes,
|
|
7806
7816
|
rawFilename,
|
|
7807
7817
|
filenameUTF8,
|
|
7808
7818
|
commentUTF8,
|
|
7809
|
-
rawExtraField: directoryArray.subarray(extraFieldOffset, commentOffset)
|
|
7819
|
+
rawExtraField: directoryArray.subarray(extraFieldOffset, commentOffset),
|
|
7820
|
+
executable
|
|
7810
7821
|
});
|
|
7822
|
+
fileEntry.internalFileAttribute = fileEntry.internalFileAttributes;
|
|
7823
|
+
fileEntry.externalFileAttribute = fileEntry.externalFileAttributes;
|
|
7811
7824
|
const decode = getOptionValue$1(zipReader, options, "decodeText") || decodeText;
|
|
7812
7825
|
const rawFilenameEncoding = filenameUTF8 ? CHARSET_UTF8 : filenameEncoding || CHARSET_CP437;
|
|
7813
7826
|
const rawCommentEncoding = commentUTF8 ? CHARSET_UTF8 : commentEncoding || CHARSET_CP437;
|
|
@@ -7835,7 +7848,8 @@
|
|
|
7835
7848
|
if (onprogress) {
|
|
7836
7849
|
try {
|
|
7837
7850
|
await onprogress(indexFile + 1, filesLength, new Entry(fileEntry));
|
|
7838
|
-
|
|
7851
|
+
// eslint-disable-next-line no-unused-vars
|
|
7852
|
+
} catch (_) {
|
|
7839
7853
|
// ignored
|
|
7840
7854
|
}
|
|
7841
7855
|
}
|
|
@@ -8047,7 +8061,8 @@
|
|
|
8047
8061
|
});
|
|
8048
8062
|
offsetExtraField += 4 + size;
|
|
8049
8063
|
}
|
|
8050
|
-
|
|
8064
|
+
// eslint-disable-next-line no-unused-vars
|
|
8065
|
+
} catch (_) {
|
|
8051
8066
|
// ignored
|
|
8052
8067
|
}
|
|
8053
8068
|
const compressionMethod = getUint16(dataView, offset + 4);
|
|
@@ -8154,7 +8169,8 @@
|
|
|
8154
8169
|
}
|
|
8155
8170
|
offsetExtraField += 4 + attributeSize;
|
|
8156
8171
|
}
|
|
8157
|
-
|
|
8172
|
+
// eslint-disable-next-line no-unused-vars
|
|
8173
|
+
} catch (_) {
|
|
8158
8174
|
// ignored
|
|
8159
8175
|
}
|
|
8160
8176
|
try {
|
|
@@ -8175,7 +8191,8 @@
|
|
|
8175
8191
|
Object.assign(extraFieldNTFS, extraFieldData);
|
|
8176
8192
|
Object.assign(directory, extraFieldData);
|
|
8177
8193
|
}
|
|
8178
|
-
|
|
8194
|
+
// eslint-disable-next-line no-unused-vars
|
|
8195
|
+
} catch (_) {
|
|
8179
8196
|
// ignored
|
|
8180
8197
|
}
|
|
8181
8198
|
}
|
|
@@ -8244,7 +8261,8 @@
|
|
|
8244
8261
|
const date = (timeRaw & 0xffff0000) >> 16, time = timeRaw & 0x0000ffff;
|
|
8245
8262
|
try {
|
|
8246
8263
|
return new Date(1980 + ((date & 0xFE00) >> 9), ((date & 0x01E0) >> 5) - 1, date & 0x001F, (time & 0xF800) >> 11, (time & 0x07E0) >> 5, (time & 0x001F) * 2, 0);
|
|
8247
|
-
|
|
8264
|
+
// eslint-disable-next-line no-unused-vars
|
|
8265
|
+
} catch (_) {
|
|
8248
8266
|
// ignored
|
|
8249
8267
|
}
|
|
8250
8268
|
}
|
|
@@ -8456,8 +8474,14 @@
|
|
|
8456
8474
|
const lastAccessDate = getOptionValue(zipWriter, options, PROPERTY_NAME_LAST_ACCESS_DATE);
|
|
8457
8475
|
const creationDate = getOptionValue(zipWriter, options, PROPERTY_NAME_CREATION_DATE);
|
|
8458
8476
|
const msDosCompatible = getOptionValue(zipWriter, options, PROPERTY_NAME_MS_DOS_COMPATIBLE, true);
|
|
8459
|
-
|
|
8460
|
-
|
|
8477
|
+
let internalFileAttributes = getOptionValue(zipWriter, options, PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTES, 0);
|
|
8478
|
+
if (internalFileAttributes === 0) {
|
|
8479
|
+
internalFileAttributes = getOptionValue(zipWriter, options, PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTE, 0);
|
|
8480
|
+
}
|
|
8481
|
+
let externalFileAttributes = getOptionValue(zipWriter, options, PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTES, 0);
|
|
8482
|
+
if (externalFileAttributes === 0) {
|
|
8483
|
+
externalFileAttributes = getOptionValue(zipWriter, options, PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTE, 0);
|
|
8484
|
+
}
|
|
8461
8485
|
const passThrough = getOptionValue(zipWriter, options, "passThrough");
|
|
8462
8486
|
let password, rawPassword;
|
|
8463
8487
|
if (!passThrough) {
|
|
@@ -8573,8 +8597,10 @@
|
|
|
8573
8597
|
dataDescriptorSignature,
|
|
8574
8598
|
signal,
|
|
8575
8599
|
msDosCompatible,
|
|
8576
|
-
internalFileAttribute,
|
|
8577
|
-
|
|
8600
|
+
internalFileAttribute: internalFileAttributes,
|
|
8601
|
+
internalFileAttributes,
|
|
8602
|
+
externalFileAttribute: externalFileAttributes,
|
|
8603
|
+
externalFileAttributes,
|
|
8578
8604
|
useCompressionStream,
|
|
8579
8605
|
passThrough,
|
|
8580
8606
|
encrypted: Boolean((password && getLength(password)) || (rawPassword && getLength(rawPassword))) || (passThrough && encrypted),
|
|
@@ -8695,7 +8721,8 @@
|
|
|
8695
8721
|
if (error) {
|
|
8696
8722
|
try {
|
|
8697
8723
|
error.corruptedEntry = true;
|
|
8698
|
-
|
|
8724
|
+
// eslint-disable-next-line no-unused-vars
|
|
8725
|
+
} catch (_) {
|
|
8699
8726
|
// ignored
|
|
8700
8727
|
}
|
|
8701
8728
|
}
|
|
@@ -8788,8 +8815,8 @@
|
|
|
8788
8815
|
encryptionStrength,
|
|
8789
8816
|
extendedTimestamp,
|
|
8790
8817
|
msDosCompatible,
|
|
8791
|
-
|
|
8792
|
-
|
|
8818
|
+
internalFileAttributes,
|
|
8819
|
+
externalFileAttributes,
|
|
8793
8820
|
useCompressionStream,
|
|
8794
8821
|
passThrough
|
|
8795
8822
|
} = options;
|
|
@@ -8808,8 +8835,8 @@
|
|
|
8808
8835
|
rawExtraField,
|
|
8809
8836
|
extendedTimestamp,
|
|
8810
8837
|
msDosCompatible,
|
|
8811
|
-
|
|
8812
|
-
|
|
8838
|
+
internalFileAttributes,
|
|
8839
|
+
externalFileAttributes,
|
|
8813
8840
|
diskNumberStart
|
|
8814
8841
|
};
|
|
8815
8842
|
let {
|
|
@@ -8969,7 +8996,8 @@
|
|
|
8969
8996
|
setBigUint64(extraFieldNTFSView, 12, lastModTimeNTFS);
|
|
8970
8997
|
setBigUint64(extraFieldNTFSView, 20, getTimeNTFS(lastAccessDate) || lastModTimeNTFS);
|
|
8971
8998
|
setBigUint64(extraFieldNTFSView, 28, getTimeNTFS(creationDate) || lastModTimeNTFS);
|
|
8972
|
-
|
|
8999
|
+
// eslint-disable-next-line no-unused-vars
|
|
9000
|
+
} catch (_) {
|
|
8973
9001
|
rawExtraFieldNTFS = new Uint8Array();
|
|
8974
9002
|
}
|
|
8975
9003
|
} else {
|
|
@@ -9264,8 +9292,8 @@
|
|
|
9264
9292
|
zip64DiskNumberStart,
|
|
9265
9293
|
zip64Offset,
|
|
9266
9294
|
msDosCompatible,
|
|
9267
|
-
|
|
9268
|
-
|
|
9295
|
+
internalFileAttributes,
|
|
9296
|
+
externalFileAttributes,
|
|
9269
9297
|
diskNumberStart,
|
|
9270
9298
|
uncompressedSize,
|
|
9271
9299
|
compressedSize
|
|
@@ -9284,9 +9312,9 @@
|
|
|
9284
9312
|
setUint16(directoryView, offset + 30, extraFieldLength);
|
|
9285
9313
|
setUint16(directoryView, offset + 32, getLength(rawComment));
|
|
9286
9314
|
setUint16(directoryView, offset + 34, zip64 && zip64DiskNumberStart ? MAX_16_BITS : diskNumberStart);
|
|
9287
|
-
setUint16(directoryView, offset + 36,
|
|
9288
|
-
if (
|
|
9289
|
-
setUint32(directoryView, offset + 38,
|
|
9315
|
+
setUint16(directoryView, offset + 36, internalFileAttributes);
|
|
9316
|
+
if (externalFileAttributes) {
|
|
9317
|
+
setUint32(directoryView, offset + 38, externalFileAttributes);
|
|
9290
9318
|
} else if (directory && msDosCompatible) {
|
|
9291
9319
|
setUint8(directoryView, offset + 38, FILE_ATTR_MSDOS_DIR_MASK);
|
|
9292
9320
|
}
|
|
@@ -9308,7 +9336,8 @@
|
|
|
9308
9336
|
if (options.onprogress) {
|
|
9309
9337
|
try {
|
|
9310
9338
|
await options.onprogress(indexFileEntry + 1, files.size, new Entry(fileEntry));
|
|
9311
|
-
|
|
9339
|
+
// eslint-disable-next-line no-unused-vars
|
|
9340
|
+
} catch (_) {
|
|
9312
9341
|
// ignored
|
|
9313
9342
|
}
|
|
9314
9343
|
}
|
|
@@ -9463,7 +9492,8 @@
|
|
|
9463
9492
|
let baseURL;
|
|
9464
9493
|
try {
|
|
9465
9494
|
baseURL = (typeof document === 'undefined' && typeof location === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : typeof document === 'undefined' ? location.href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('zip-full.js', document.baseURI).href));
|
|
9466
|
-
|
|
9495
|
+
// eslint-disable-next-line no-unused-vars
|
|
9496
|
+
} catch (_) {
|
|
9467
9497
|
// ignored
|
|
9468
9498
|
}
|
|
9469
9499
|
e(configure);
|