@zip.js/zip.js 2.8.61 → 2.9.0
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-core-external.js +11 -4
- package/dist/zip-core-external.min.js +1 -1
- package/dist/zip-core.js +11 -3
- package/dist/zip-core.min.js +1 -1
- package/dist/zip-fs-core-external.js +11 -4
- package/dist/zip-fs-core-external.min.js +1 -1
- package/dist/zip-fs-core.js +11 -3
- package/dist/zip-fs-core.min.js +1 -1
- package/dist/zip-fs-external.js +11 -4
- package/dist/zip-fs-external.min.js +1 -1
- package/dist/zip-fs-native.js +11 -3
- package/dist/zip-fs-native.min.js +1 -1
- package/dist/zip-fs.js +11 -3
- package/dist/zip-fs.min.js +1 -1
- package/dist/zip-legacy.js +11 -3
- package/dist/zip-legacy.min.js +1 -1
- package/dist/zip-native.js +11 -3
- package/dist/zip-native.min.js +1 -1
- package/dist/zip.js +11 -3
- package/dist/zip.min.js +1 -1
- package/index-native.cjs +11 -3
- package/index-native.min.js +1 -1
- package/index.cjs +11 -3
- package/index.d.cts +17 -2
- package/index.d.ts +17 -2
- package/index.min.js +1 -1
- package/lib/core/streams/codecs/crc32.js +1 -1
- package/lib/core/util/decode-cp437.js +1 -1
- package/lib/core/version.js +1 -1
- package/lib/core/zip-reader.js +7 -0
- package/lib/zip-core-reader.js +1 -0
- package/package.json +1 -1
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
// Every table MUST stay a PACKED_SMI array: build with array literals (not `new Array(n)`,
|
|
34
34
|
// which is HOLEY) and store the signed int32 XOR result (no `>>> 0`). An unsigned or holey
|
|
35
35
|
// table becomes a V8 FixedDoubleArray whose every hot-loop lookup unboxes a double (~1.6x
|
|
36
|
-
// slower). Signedness is irrelevant to the result
|
|
36
|
+
// slower). Signedness is irrelevant to the result: the reads mask/shift it and the final
|
|
37
37
|
// `~crc` normalizes it. Do NOT reintroduce `>>> 0` here or switch to `new Array(256)`.
|
|
38
38
|
const T = [[], [], [], [], [], [], [], []];
|
|
39
39
|
for (let n = 0; n < 256; n++) {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
|
|
29
29
|
/* global TextDecoder */
|
|
30
30
|
|
|
31
|
-
const CP437 = "\0
|
|
31
|
+
const CP437 = "\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\u00B6\u00A7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\u00C7\u00FC\u00E9\u00E2\u00E4\u00E0\u00E5\u00E7\u00EA\u00EB\u00E8\u00EF\u00EE\u00EC\u00C4\u00C5\u00C9\u00E6\u00C6\u00F4\u00F6\u00F2\u00FB\u00F9\u00FF\u00D6\u00DC\u00A2\u00A3\u00A5\u20A7\u0192\u00E1\u00ED\u00F3\u00FA\u00F1\u00D1\u00AA\u00BA\u00BF\u2310\u00AC\u00BD\u00BC\u00A1\u00AB\u00BB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\u00DF\u0393\u03C0\u03A3\u03C3\u00B5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\u00B1\u2265\u2264\u2320\u2321\u00F7\u2248\u00B0\u2219\u00B7\u221A\u207F\u00B2\u25A0\u00A0".split("");
|
|
32
32
|
const VALID_CP437 = CP437.length == 256;
|
|
33
33
|
|
|
34
34
|
export {
|
package/lib/core/version.js
CHANGED
package/lib/core/zip-reader.js
CHANGED
|
@@ -205,6 +205,7 @@ const WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA = "unknown zip64 extensible data";
|
|
|
205
205
|
const WARNING_WRAPPED_ENTRIES_COUNT = "wrapped entries count";
|
|
206
206
|
const WARNING_APPENDED_DATA = "appended data";
|
|
207
207
|
const WARNING_PREPENDED_DATA = "prepended data";
|
|
208
|
+
const WARNING_PREPENDED_CENTRAL_DIRECTORY = "prepended central directory";
|
|
208
209
|
const WARNING_TRAILING_CENTRAL_DIRECTORY_DATA = "trailing central directory data";
|
|
209
210
|
const WARNING_DUPLICATE_FILENAME = "duplicate filename";
|
|
210
211
|
const WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY = "mismatched zip64 end of central directory record";
|
|
@@ -298,6 +299,7 @@ class ZipReader {
|
|
|
298
299
|
let diskNumber = getUint16(endOfDirectoryView, 6);
|
|
299
300
|
let filesLength = getUint16(endOfDirectoryView, 10);
|
|
300
301
|
let prependedDataLength = 0;
|
|
302
|
+
let prependedCentralDirectory;
|
|
301
303
|
let startOffset;
|
|
302
304
|
let zip64EndOfDirectory;
|
|
303
305
|
let zip64EndOfDirectoryVersion2;
|
|
@@ -401,6 +403,7 @@ class ZipReader {
|
|
|
401
403
|
directoryDataOffset = expectedDirectoryDataOffset;
|
|
402
404
|
if (directoryDataOffset > originalDirectoryDataOffset) {
|
|
403
405
|
prependedDataLength += directoryDataOffset - originalDirectoryDataOffset;
|
|
406
|
+
prependedCentralDirectory = storedPointsAtDirectory;
|
|
404
407
|
}
|
|
405
408
|
directoryArray = await readUint8Array(reader, directoryDataOffset, directoryDataLength);
|
|
406
409
|
directoryView = getDataView(directoryArray);
|
|
@@ -628,6 +631,9 @@ class ZipReader {
|
|
|
628
631
|
if (prependedDataLength || (filesLength && startOffset > SPLIT_ZIP_FILE_SIGNATURE_LENGTH)) {
|
|
629
632
|
addWarning(warnings, WARNING_PREPENDED_DATA);
|
|
630
633
|
}
|
|
634
|
+
if (prependedCentralDirectory) {
|
|
635
|
+
addWarning(warnings, WARNING_PREPENDED_CENTRAL_DIRECTORY);
|
|
636
|
+
}
|
|
631
637
|
if (extractPrependedData) {
|
|
632
638
|
zipReader.prependedData = startOffset > splitZipSignatureLength ?
|
|
633
639
|
await readUint8Array(reader, splitZipSignatureLength, startOffset - splitZipSignatureLength) :
|
|
@@ -756,6 +762,7 @@ export {
|
|
|
756
762
|
WARNING_WRAPPED_ENTRIES_COUNT,
|
|
757
763
|
WARNING_APPENDED_DATA,
|
|
758
764
|
WARNING_PREPENDED_DATA,
|
|
765
|
+
WARNING_PREPENDED_CENTRAL_DIRECTORY,
|
|
759
766
|
WARNING_TRAILING_CENTRAL_DIRECTORY_DATA,
|
|
760
767
|
WARNING_DUPLICATE_FILENAME,
|
|
761
768
|
WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY,
|
package/lib/zip-core-reader.js
CHANGED
|
@@ -66,6 +66,7 @@ export {
|
|
|
66
66
|
WARNING_WRAPPED_ENTRIES_COUNT,
|
|
67
67
|
WARNING_APPENDED_DATA,
|
|
68
68
|
WARNING_PREPENDED_DATA,
|
|
69
|
+
WARNING_PREPENDED_CENTRAL_DIRECTORY,
|
|
69
70
|
WARNING_TRAILING_CENTRAL_DIRECTORY_DATA,
|
|
70
71
|
WARNING_DUPLICATE_FILENAME,
|
|
71
72
|
WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY,
|
package/package.json
CHANGED