@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/deno.json
CHANGED
package/dist/zip-fs-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 = {
|
|
@@ -7396,7 +7391,8 @@
|
|
|
7396
7391
|
if (IMPORT_KEY_SUPPORTED) {
|
|
7397
7392
|
try {
|
|
7398
7393
|
return await subtle.importKey(format, password, algorithm, extractable, keyUsages);
|
|
7399
|
-
|
|
7394
|
+
// eslint-disable-next-line no-unused-vars
|
|
7395
|
+
} catch (_) {
|
|
7400
7396
|
IMPORT_KEY_SUPPORTED = false;
|
|
7401
7397
|
return misc.importKey(password);
|
|
7402
7398
|
}
|
|
@@ -7409,7 +7405,8 @@
|
|
|
7409
7405
|
if (DERIVE_BITS_SUPPORTED) {
|
|
7410
7406
|
try {
|
|
7411
7407
|
return await subtle.deriveBits(algorithm, baseKey, length);
|
|
7412
|
-
|
|
7408
|
+
// eslint-disable-next-line no-unused-vars
|
|
7409
|
+
} catch (_) {
|
|
7413
7410
|
DERIVE_BITS_SUPPORTED = false;
|
|
7414
7411
|
return misc.pbkdf2(baseKey, algorithm.salt, DERIVED_BITS_ALGORITHM.iterations, length);
|
|
7415
7412
|
}
|
|
@@ -7727,11 +7724,13 @@
|
|
|
7727
7724
|
try {
|
|
7728
7725
|
const CompressionStream = useCompressionStream && CodecStreamNative ? CodecStreamNative : CodecStream;
|
|
7729
7726
|
readable = pipeThrough(readable, new CompressionStream(COMPRESSION_FORMAT, options));
|
|
7730
|
-
|
|
7727
|
+
// eslint-disable-next-line no-unused-vars
|
|
7728
|
+
} catch (_) {
|
|
7731
7729
|
if (useCompressionStream) {
|
|
7732
7730
|
try {
|
|
7733
7731
|
readable = pipeThrough(readable, new CodecStream(COMPRESSION_FORMAT, options));
|
|
7734
|
-
|
|
7732
|
+
// eslint-disable-next-line no-unused-vars
|
|
7733
|
+
} catch (_) {
|
|
7735
7734
|
return readable;
|
|
7736
7735
|
}
|
|
7737
7736
|
} else {
|
|
@@ -7974,7 +7973,8 @@
|
|
|
7974
7973
|
async function callHandler(handler, ...parameters) {
|
|
7975
7974
|
try {
|
|
7976
7975
|
await handler(...parameters);
|
|
7977
|
-
|
|
7976
|
+
// eslint-disable-next-line no-unused-vars
|
|
7977
|
+
} catch (_) {
|
|
7978
7978
|
// ignored
|
|
7979
7979
|
}
|
|
7980
7980
|
}
|
|
@@ -7991,7 +7991,8 @@
|
|
|
7991
7991
|
let worker;
|
|
7992
7992
|
try {
|
|
7993
7993
|
worker = getWebWorker(workerData.scripts[0], baseURL, workerData);
|
|
7994
|
-
|
|
7994
|
+
// eslint-disable-next-line no-unused-vars
|
|
7995
|
+
} catch (_) {
|
|
7995
7996
|
WEB_WORKERS_SUPPORTED = false;
|
|
7996
7997
|
return createWorkerInterface(workerData, config);
|
|
7997
7998
|
}
|
|
@@ -8094,13 +8095,15 @@
|
|
|
8094
8095
|
}
|
|
8095
8096
|
try {
|
|
8096
8097
|
scriptUrl = new URL(url, baseURL);
|
|
8097
|
-
|
|
8098
|
+
// eslint-disable-next-line no-unused-vars
|
|
8099
|
+
} catch (_) {
|
|
8098
8100
|
scriptUrl = url;
|
|
8099
8101
|
}
|
|
8100
8102
|
if (classicWorkersSupported) {
|
|
8101
8103
|
try {
|
|
8102
8104
|
worker = new Worker(scriptUrl);
|
|
8103
|
-
|
|
8105
|
+
// eslint-disable-next-line no-unused-vars
|
|
8106
|
+
} catch (_) {
|
|
8104
8107
|
classicWorkersSupported = false;
|
|
8105
8108
|
worker = new Worker(scriptUrl, workerOptions);
|
|
8106
8109
|
}
|
|
@@ -8138,7 +8141,8 @@
|
|
|
8138
8141
|
try {
|
|
8139
8142
|
worker.postMessage(message, transferables);
|
|
8140
8143
|
return true;
|
|
8141
|
-
|
|
8144
|
+
// eslint-disable-next-line no-unused-vars
|
|
8145
|
+
} catch (_) {
|
|
8142
8146
|
transferStreamsSupported = false;
|
|
8143
8147
|
message.readable = message.writable = null;
|
|
8144
8148
|
worker.postMessage(message);
|
|
@@ -8281,7 +8285,8 @@
|
|
|
8281
8285
|
pool = pool.filter(data => data != workerData);
|
|
8282
8286
|
try {
|
|
8283
8287
|
await workerData.terminate();
|
|
8284
|
-
|
|
8288
|
+
// eslint-disable-next-line no-unused-vars
|
|
8289
|
+
} catch (_) {
|
|
8285
8290
|
// ignored
|
|
8286
8291
|
}
|
|
8287
8292
|
}, terminateWorkerTimeout);
|
|
@@ -8686,7 +8691,7 @@
|
|
|
8686
8691
|
combineSizeEocd
|
|
8687
8692
|
} = httpReader;
|
|
8688
8693
|
if (isHttpFamily(url) && (useRangeHeader || forceRangeRequests) && (typeof preventHeadRequest == "undefined" || preventHeadRequest)) {
|
|
8689
|
-
const response = await sendRequest(HTTP_METHOD_GET, httpReader, getRangeHeaders(httpReader, combineSizeEocd ? -
|
|
8694
|
+
const response = await sendRequest(HTTP_METHOD_GET, httpReader, getRangeHeaders(httpReader, combineSizeEocd ? -22 : undefined));
|
|
8690
8695
|
if (!forceRangeRequests && response.headers.get(HTTP_HEADER_ACCEPT_RANGES) != HTTP_RANGE_UNIT) {
|
|
8691
8696
|
throw new Error(ERR_HTTP_RANGE);
|
|
8692
8697
|
} else {
|
|
@@ -9209,7 +9214,9 @@
|
|
|
9209
9214
|
const PROPERTY_NAME_CREATION_DATE = "creationDate";
|
|
9210
9215
|
const PROPERTY_NAME_RAW_CREATION_DATE = "rawCreationDate";
|
|
9211
9216
|
const PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTE = "internalFileAttribute";
|
|
9217
|
+
const PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTES = "internalFileAttributes";
|
|
9212
9218
|
const PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTE = "externalFileAttribute";
|
|
9219
|
+
const PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTES = "externalFileAttributes";
|
|
9213
9220
|
const PROPERTY_NAME_MS_DOS_COMPATIBLE = "msDosCompatible";
|
|
9214
9221
|
const PROPERTY_NAME_ZIP64 = "zip64";
|
|
9215
9222
|
const PROPERTY_NAME_ENCRYPTED = "encrypted";
|
|
@@ -9221,10 +9228,7 @@
|
|
|
9221
9228
|
PROPERTY_NAME_FILENAME, PROPERTY_NAME_RAW_FILENAME, PROPERTY_NAME_COMPPRESSED_SIZE, PROPERTY_NAME_UNCOMPPRESSED_SIZE,
|
|
9222
9229
|
PROPERTY_NAME_LAST_MODIFICATION_DATE, PROPERTY_NAME_RAW_LAST_MODIFICATION_DATE, PROPERTY_NAME_COMMENT, PROPERTY_NAME_RAW_COMMENT,
|
|
9223
9230
|
PROPERTY_NAME_LAST_ACCESS_DATE, PROPERTY_NAME_CREATION_DATE, PROPERTY_NAME_OFFSET, PROPERTY_NAME_DISK_NUMBER_START,
|
|
9224
|
-
PROPERTY_NAME_DISK_NUMBER_START, PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTE, PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTE,
|
|
9225
|
-
PROPERTY_NAME_MS_DOS_COMPATIBLE, PROPERTY_NAME_ZIP64, PROPERTY_NAME_ENCRYPTED, PROPERTY_NAME_VERSION, PROPERTY_NAME_VERSION_MADE_BY,
|
|
9226
|
-
PROPERTY_NAME_ZIPCRYPTO, "directory", "bitFlag", "signature", "filenameUTF8", "commentUTF8", "compressionMethod", "extraField", "rawExtraField",
|
|
9227
|
-
"extraFieldZip64", "extraFieldUnicodePath", "extraFieldUnicodeComment", "extraFieldAES", "extraFieldNTFS", "extraFieldExtendedTimestamp"];
|
|
9231
|
+
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"];
|
|
9228
9232
|
|
|
9229
9233
|
class Entry {
|
|
9230
9234
|
|
|
@@ -9415,14 +9419,20 @@
|
|
|
9415
9419
|
const extraFieldOffset = filenameOffset + fileEntry.filenameLength;
|
|
9416
9420
|
const commentOffset = extraFieldOffset + fileEntry.extraFieldLength;
|
|
9417
9421
|
const versionMadeBy = getUint16(directoryView, offset + 4);
|
|
9418
|
-
const msDosCompatible =
|
|
9422
|
+
const msDosCompatible = versionMadeBy >> 8 == 0;
|
|
9423
|
+
const unixCompatible = versionMadeBy >> 8 == 3;
|
|
9419
9424
|
const rawFilename = directoryArray.subarray(filenameOffset, extraFieldOffset);
|
|
9420
9425
|
const commentLength = getUint16(directoryView, offset + 32);
|
|
9421
9426
|
const endOffset = commentOffset + commentLength;
|
|
9422
9427
|
const rawComment = directoryArray.subarray(commentOffset, endOffset);
|
|
9423
9428
|
const filenameUTF8 = languageEncodingFlag;
|
|
9424
9429
|
const commentUTF8 = languageEncodingFlag;
|
|
9425
|
-
const
|
|
9430
|
+
const externalFileAttributes = getUint32(directoryView, offset + 38);
|
|
9431
|
+
const directory =
|
|
9432
|
+
(msDosCompatible && ((getUint8(directoryView, offset + 38) & FILE_ATTR_MSDOS_DIR_MASK) == FILE_ATTR_MSDOS_DIR_MASK)) ||
|
|
9433
|
+
(unixCompatible && (((externalFileAttributes >> 16) & FILE_ATTR_UNIX_DIR_MASK) == FILE_ATTR_UNIX_DIR_MASK)) ||
|
|
9434
|
+
(rawFilename.length && rawFilename[rawFilename.length - 1] == DIRECTORY_SIGNATURE.charCodeAt(0));
|
|
9435
|
+
const executable = (unixCompatible && (((externalFileAttributes >> 16) & FILE_ATTR_UNIX_EXECUTABLE_MASK) == FILE_ATTR_UNIX_EXECUTABLE_MASK));
|
|
9426
9436
|
const offsetFileEntry = getUint32(directoryView, offset + 42) + prependedDataLength;
|
|
9427
9437
|
Object.assign(fileEntry, {
|
|
9428
9438
|
versionMadeBy,
|
|
@@ -9433,13 +9443,16 @@
|
|
|
9433
9443
|
directory,
|
|
9434
9444
|
offset: offsetFileEntry,
|
|
9435
9445
|
diskNumberStart: getUint16(directoryView, offset + 34),
|
|
9436
|
-
|
|
9437
|
-
|
|
9446
|
+
internalFileAttributes: getUint16(directoryView, offset + 36),
|
|
9447
|
+
externalFileAttributes,
|
|
9438
9448
|
rawFilename,
|
|
9439
9449
|
filenameUTF8,
|
|
9440
9450
|
commentUTF8,
|
|
9441
|
-
rawExtraField: directoryArray.subarray(extraFieldOffset, commentOffset)
|
|
9451
|
+
rawExtraField: directoryArray.subarray(extraFieldOffset, commentOffset),
|
|
9452
|
+
executable
|
|
9442
9453
|
});
|
|
9454
|
+
fileEntry.internalFileAttribute = fileEntry.internalFileAttributes;
|
|
9455
|
+
fileEntry.externalFileAttribute = fileEntry.externalFileAttributes;
|
|
9443
9456
|
const decode = getOptionValue$1(zipReader, options, "decodeText") || decodeText;
|
|
9444
9457
|
const rawFilenameEncoding = filenameUTF8 ? CHARSET_UTF8 : filenameEncoding || CHARSET_CP437;
|
|
9445
9458
|
const rawCommentEncoding = commentUTF8 ? CHARSET_UTF8 : commentEncoding || CHARSET_CP437;
|
|
@@ -9467,7 +9480,8 @@
|
|
|
9467
9480
|
if (onprogress) {
|
|
9468
9481
|
try {
|
|
9469
9482
|
await onprogress(indexFile + 1, filesLength, new Entry(fileEntry));
|
|
9470
|
-
|
|
9483
|
+
// eslint-disable-next-line no-unused-vars
|
|
9484
|
+
} catch (_) {
|
|
9471
9485
|
// ignored
|
|
9472
9486
|
}
|
|
9473
9487
|
}
|
|
@@ -9679,7 +9693,8 @@
|
|
|
9679
9693
|
});
|
|
9680
9694
|
offsetExtraField += 4 + size;
|
|
9681
9695
|
}
|
|
9682
|
-
|
|
9696
|
+
// eslint-disable-next-line no-unused-vars
|
|
9697
|
+
} catch (_) {
|
|
9683
9698
|
// ignored
|
|
9684
9699
|
}
|
|
9685
9700
|
const compressionMethod = getUint16(dataView, offset + 4);
|
|
@@ -9786,7 +9801,8 @@
|
|
|
9786
9801
|
}
|
|
9787
9802
|
offsetExtraField += 4 + attributeSize;
|
|
9788
9803
|
}
|
|
9789
|
-
|
|
9804
|
+
// eslint-disable-next-line no-unused-vars
|
|
9805
|
+
} catch (_) {
|
|
9790
9806
|
// ignored
|
|
9791
9807
|
}
|
|
9792
9808
|
try {
|
|
@@ -9807,7 +9823,8 @@
|
|
|
9807
9823
|
Object.assign(extraFieldNTFS, extraFieldData);
|
|
9808
9824
|
Object.assign(directory, extraFieldData);
|
|
9809
9825
|
}
|
|
9810
|
-
|
|
9826
|
+
// eslint-disable-next-line no-unused-vars
|
|
9827
|
+
} catch (_) {
|
|
9811
9828
|
// ignored
|
|
9812
9829
|
}
|
|
9813
9830
|
}
|
|
@@ -9876,7 +9893,8 @@
|
|
|
9876
9893
|
const date = (timeRaw & 0xffff0000) >> 16, time = timeRaw & 0x0000ffff;
|
|
9877
9894
|
try {
|
|
9878
9895
|
return new Date(1980 + ((date & 0xFE00) >> 9), ((date & 0x01E0) >> 5) - 1, date & 0x001F, (time & 0xF800) >> 11, (time & 0x07E0) >> 5, (time & 0x001F) * 2, 0);
|
|
9879
|
-
|
|
9896
|
+
// eslint-disable-next-line no-unused-vars
|
|
9897
|
+
} catch (_) {
|
|
9880
9898
|
// ignored
|
|
9881
9899
|
}
|
|
9882
9900
|
}
|
|
@@ -10088,8 +10106,14 @@
|
|
|
10088
10106
|
const lastAccessDate = getOptionValue(zipWriter, options, PROPERTY_NAME_LAST_ACCESS_DATE);
|
|
10089
10107
|
const creationDate = getOptionValue(zipWriter, options, PROPERTY_NAME_CREATION_DATE);
|
|
10090
10108
|
const msDosCompatible = getOptionValue(zipWriter, options, PROPERTY_NAME_MS_DOS_COMPATIBLE, true);
|
|
10091
|
-
|
|
10092
|
-
|
|
10109
|
+
let internalFileAttributes = getOptionValue(zipWriter, options, PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTES, 0);
|
|
10110
|
+
if (internalFileAttributes === 0) {
|
|
10111
|
+
internalFileAttributes = getOptionValue(zipWriter, options, PROPERTY_NAME_INTERNAL_FILE_ATTRIBUTE, 0);
|
|
10112
|
+
}
|
|
10113
|
+
let externalFileAttributes = getOptionValue(zipWriter, options, PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTES, 0);
|
|
10114
|
+
if (externalFileAttributes === 0) {
|
|
10115
|
+
externalFileAttributes = getOptionValue(zipWriter, options, PROPERTY_NAME_EXTERNAL_FILE_ATTRIBUTE, 0);
|
|
10116
|
+
}
|
|
10093
10117
|
const passThrough = getOptionValue(zipWriter, options, "passThrough");
|
|
10094
10118
|
let password, rawPassword;
|
|
10095
10119
|
if (!passThrough) {
|
|
@@ -10205,8 +10229,10 @@
|
|
|
10205
10229
|
dataDescriptorSignature,
|
|
10206
10230
|
signal,
|
|
10207
10231
|
msDosCompatible,
|
|
10208
|
-
internalFileAttribute,
|
|
10209
|
-
|
|
10232
|
+
internalFileAttribute: internalFileAttributes,
|
|
10233
|
+
internalFileAttributes,
|
|
10234
|
+
externalFileAttribute: externalFileAttributes,
|
|
10235
|
+
externalFileAttributes,
|
|
10210
10236
|
useCompressionStream,
|
|
10211
10237
|
passThrough,
|
|
10212
10238
|
encrypted: Boolean((password && getLength(password)) || (rawPassword && getLength(rawPassword))) || (passThrough && encrypted),
|
|
@@ -10327,7 +10353,8 @@
|
|
|
10327
10353
|
if (error) {
|
|
10328
10354
|
try {
|
|
10329
10355
|
error.corruptedEntry = true;
|
|
10330
|
-
|
|
10356
|
+
// eslint-disable-next-line no-unused-vars
|
|
10357
|
+
} catch (_) {
|
|
10331
10358
|
// ignored
|
|
10332
10359
|
}
|
|
10333
10360
|
}
|
|
@@ -10420,8 +10447,8 @@
|
|
|
10420
10447
|
encryptionStrength,
|
|
10421
10448
|
extendedTimestamp,
|
|
10422
10449
|
msDosCompatible,
|
|
10423
|
-
|
|
10424
|
-
|
|
10450
|
+
internalFileAttributes,
|
|
10451
|
+
externalFileAttributes,
|
|
10425
10452
|
useCompressionStream,
|
|
10426
10453
|
passThrough
|
|
10427
10454
|
} = options;
|
|
@@ -10440,8 +10467,8 @@
|
|
|
10440
10467
|
rawExtraField,
|
|
10441
10468
|
extendedTimestamp,
|
|
10442
10469
|
msDosCompatible,
|
|
10443
|
-
|
|
10444
|
-
|
|
10470
|
+
internalFileAttributes,
|
|
10471
|
+
externalFileAttributes,
|
|
10445
10472
|
diskNumberStart
|
|
10446
10473
|
};
|
|
10447
10474
|
let {
|
|
@@ -10601,7 +10628,8 @@
|
|
|
10601
10628
|
setBigUint64(extraFieldNTFSView, 12, lastModTimeNTFS);
|
|
10602
10629
|
setBigUint64(extraFieldNTFSView, 20, getTimeNTFS(lastAccessDate) || lastModTimeNTFS);
|
|
10603
10630
|
setBigUint64(extraFieldNTFSView, 28, getTimeNTFS(creationDate) || lastModTimeNTFS);
|
|
10604
|
-
|
|
10631
|
+
// eslint-disable-next-line no-unused-vars
|
|
10632
|
+
} catch (_) {
|
|
10605
10633
|
rawExtraFieldNTFS = new Uint8Array();
|
|
10606
10634
|
}
|
|
10607
10635
|
} else {
|
|
@@ -10896,8 +10924,8 @@
|
|
|
10896
10924
|
zip64DiskNumberStart,
|
|
10897
10925
|
zip64Offset,
|
|
10898
10926
|
msDosCompatible,
|
|
10899
|
-
|
|
10900
|
-
|
|
10927
|
+
internalFileAttributes,
|
|
10928
|
+
externalFileAttributes,
|
|
10901
10929
|
diskNumberStart,
|
|
10902
10930
|
uncompressedSize,
|
|
10903
10931
|
compressedSize
|
|
@@ -10916,9 +10944,9 @@
|
|
|
10916
10944
|
setUint16(directoryView, offset + 30, extraFieldLength);
|
|
10917
10945
|
setUint16(directoryView, offset + 32, getLength(rawComment));
|
|
10918
10946
|
setUint16(directoryView, offset + 34, zip64 && zip64DiskNumberStart ? MAX_16_BITS : diskNumberStart);
|
|
10919
|
-
setUint16(directoryView, offset + 36,
|
|
10920
|
-
if (
|
|
10921
|
-
setUint32(directoryView, offset + 38,
|
|
10947
|
+
setUint16(directoryView, offset + 36, internalFileAttributes);
|
|
10948
|
+
if (externalFileAttributes) {
|
|
10949
|
+
setUint32(directoryView, offset + 38, externalFileAttributes);
|
|
10922
10950
|
} else if (directory && msDosCompatible) {
|
|
10923
10951
|
setUint8(directoryView, offset + 38, FILE_ATTR_MSDOS_DIR_MASK);
|
|
10924
10952
|
}
|
|
@@ -10940,7 +10968,8 @@
|
|
|
10940
10968
|
if (options.onprogress) {
|
|
10941
10969
|
try {
|
|
10942
10970
|
await options.onprogress(indexFileEntry + 1, files.size, new Entry(fileEntry));
|
|
10943
|
-
|
|
10971
|
+
// eslint-disable-next-line no-unused-vars
|
|
10972
|
+
} catch (_) {
|
|
10944
10973
|
// ignored
|
|
10945
10974
|
}
|
|
10946
10975
|
}
|
|
@@ -11463,7 +11492,8 @@
|
|
|
11463
11492
|
error.cause = {
|
|
11464
11493
|
entry
|
|
11465
11494
|
};
|
|
11466
|
-
|
|
11495
|
+
// eslint-disable-next-line no-unused-vars
|
|
11496
|
+
} catch (_) {
|
|
11467
11497
|
// ignored
|
|
11468
11498
|
}
|
|
11469
11499
|
throw error;
|
|
@@ -11720,7 +11750,8 @@
|
|
|
11720
11750
|
error.cause = {
|
|
11721
11751
|
entry: child
|
|
11722
11752
|
};
|
|
11723
|
-
|
|
11753
|
+
// eslint-disable-next-line no-unused-vars
|
|
11754
|
+
} catch (_) {
|
|
11724
11755
|
// ignored
|
|
11725
11756
|
}
|
|
11726
11757
|
throw error;
|
|
@@ -11766,7 +11797,7 @@
|
|
|
11766
11797
|
let zipEntryOptions = {};
|
|
11767
11798
|
if (child.data instanceof Entry) {
|
|
11768
11799
|
const {
|
|
11769
|
-
|
|
11800
|
+
externalFileAttributes,
|
|
11770
11801
|
versionMadeBy,
|
|
11771
11802
|
comment,
|
|
11772
11803
|
lastModDate,
|
|
@@ -11780,7 +11811,7 @@
|
|
|
11780
11811
|
extraFieldAES
|
|
11781
11812
|
} = child.data;
|
|
11782
11813
|
zipEntryOptions = {
|
|
11783
|
-
|
|
11814
|
+
externalFileAttributes,
|
|
11784
11815
|
versionMadeBy,
|
|
11785
11816
|
comment,
|
|
11786
11817
|
lastModDate,
|
|
@@ -11815,7 +11846,8 @@
|
|
|
11815
11846
|
entryOffsets.set(name, indexProgress);
|
|
11816
11847
|
try {
|
|
11817
11848
|
await options.onprogress(Array.from(entryOffsets.values()).reduce((previousValue, currentValue) => previousValue + currentValue), totalSize);
|
|
11818
|
-
|
|
11849
|
+
// eslint-disable-next-line no-unused-vars
|
|
11850
|
+
} catch (_) {
|
|
11819
11851
|
// ignored
|
|
11820
11852
|
}
|
|
11821
11853
|
}
|
|
@@ -11960,7 +11992,8 @@
|
|
|
11960
11992
|
let baseURL;
|
|
11961
11993
|
try {
|
|
11962
11994
|
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-fs-full.js', document.baseURI).href));
|
|
11963
|
-
|
|
11995
|
+
// eslint-disable-next-line no-unused-vars
|
|
11996
|
+
} catch (_) {
|
|
11964
11997
|
// ignored
|
|
11965
11998
|
}
|
|
11966
11999
|
configure({ baseURL });
|