@zip.js/zip.js 2.6.11 → 2.6.14
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/cli-deno/mc-zip.js +1 -1
- package/dist/zip-fs-full.js +26 -17
- package/dist/zip-fs-full.min.js +1 -1
- package/dist/zip-fs.js +26 -17
- package/dist/zip-fs.min.js +1 -1
- package/dist/zip-full.js +25 -16
- 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 +25 -16
- package/dist/zip.min.js +1 -1
- package/index.d.ts +3 -2
- package/lib/core/io.js +11 -10
- package/lib/core/util/cp437-decode.js +12 -5
- package/lib/core/zip-fs-core.js +1 -1
- package/lib/core/zip-reader.js +2 -1
- package/package.json +16 -7
- package/tests/all/loader.html +2 -4
- package/tests/all/test-abort-signal-read.js +0 -1
- package/tests/all/test-abort-signal-write.js +0 -1
- package/tests/all/test-array.js +3 -1
- package/tests/all/test-base64.js +3 -1
- package/tests/all/test-blob.js +5 -1
- package/tests/all/test-codecs-interoperability.js +3 -1
- package/tests/all/test-crc.js +7 -12
- package/tests/all/test-crypto.js +3 -1
- package/tests/all/test-custom-io.js +3 -1
- package/tests/all/test-data-descriptor-signature.js +7 -1
- package/tests/all/test-data-descriptor.js +7 -1
- package/tests/all/test-duplicated-filename.js +1 -1
- package/tests/all/test-empty.js +3 -1
- package/tests/all/test-extended-timestamp.js +3 -1
- package/tests/all/test-extra-field.js +3 -2
- package/tests/all/test-fflate-no-worker.js +3 -1
- package/tests/all/test-fflate.js +3 -1
- package/tests/all/test-fs-base64.js +3 -1
- package/tests/all/test-fs-export-options.js +3 -1
- package/tests/all/test-fs-http-import.js +3 -1
- package/tests/all/test-fs-http-reader.js +3 -1
- package/tests/all/test-fs-replace.js +3 -1
- package/tests/all/test-fs-streams.js +3 -1
- package/tests/all/test-fs-text.js +3 -1
- package/tests/all/test-fs-unzip-store.js +3 -1
- package/tests/all/test-fs.js +3 -1
- package/tests/all/test-http-crypto.js +3 -2
- package/tests/all/test-http-range.js +3 -2
- package/tests/all/test-http-zip64.js +3 -2
- package/tests/all/test-invalid-crc.js +3 -1
- package/tests/all/test-no-worker.js +3 -1
- package/tests/all/test-pako-no-worker.js +3 -1
- package/tests/all/test-pako.js +3 -1
- package/tests/all/test-parallel-reads.js +3 -1
- package/tests/all/test-parallel-writes-auto-buffered.js +3 -1
- package/tests/all/test-parallel-writes-ordered.js +4 -2
- package/tests/all/test-parallel-writes.js +3 -1
- package/tests/all/test-readable-stream.js +8 -12
- package/tests/all/test-readable-zip-stream.js +3 -2
- package/tests/all/test-safe-closing.js +3 -1
- package/tests/all/test-store.js +9 -1
- package/tests/all/test-sw-worker.js +0 -1
- package/tests/all/test-sw.js +0 -1
- package/tests/all/test-worker-timeout.js +7 -12
- package/tests/all/test-wrapped.js +4 -2
- package/tests/all/test-writable-stream.js +23 -25
- package/tests/all/test-zip64-auto.js +3 -1
- package/tests/all/test-zip64-crypto.js +3 -1
- package/tests/all/test-zip64.js +3 -1
- package/tests/all/test-zipcrypto.js +3 -1
- package/tests/node-runner.js +17 -9
- package/build.sh +0 -3
- package/tests/run-tests.sh +0 -3
package/dist/zip-full.js
CHANGED
|
@@ -6950,18 +6950,19 @@
|
|
|
6950
6950
|
|
|
6951
6951
|
class Uint8ArrayWriter extends Writer {
|
|
6952
6952
|
|
|
6953
|
-
|
|
6954
|
-
|
|
6955
|
-
this.array = new Uint8Array();
|
|
6953
|
+
init(initSize = 0) {
|
|
6954
|
+
this.array = new Uint8Array(initSize);
|
|
6956
6955
|
}
|
|
6957
6956
|
|
|
6958
6957
|
writeUint8Array(array) {
|
|
6959
|
-
super.writeUint8Array(array);
|
|
6960
6958
|
const writer = this;
|
|
6961
|
-
|
|
6962
|
-
|
|
6963
|
-
|
|
6964
|
-
|
|
6959
|
+
if (writer.size + array.length > writer.array.length) {
|
|
6960
|
+
const previousArray = writer.array;
|
|
6961
|
+
writer.array = new Uint8Array(previousArray.length + array.length);
|
|
6962
|
+
writer.array.set(previousArray);
|
|
6963
|
+
}
|
|
6964
|
+
writer.array.set(array, writer.size);
|
|
6965
|
+
super.writeUint8Array(array);
|
|
6965
6966
|
}
|
|
6966
6967
|
|
|
6967
6968
|
getData() {
|
|
@@ -6975,9 +6976,9 @@
|
|
|
6975
6976
|
return protocol == "http:" || protocol == "https:";
|
|
6976
6977
|
}
|
|
6977
6978
|
|
|
6978
|
-
async function initStream(stream) {
|
|
6979
|
+
async function initStream(stream, initSize) {
|
|
6979
6980
|
if (stream.init && !stream.initialized) {
|
|
6980
|
-
await stream.init();
|
|
6981
|
+
await stream.init(initSize);
|
|
6981
6982
|
}
|
|
6982
6983
|
}
|
|
6983
6984
|
|
|
@@ -7079,14 +7080,21 @@
|
|
|
7079
7080
|
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
7080
7081
|
*/
|
|
7081
7082
|
|
|
7083
|
+
/* global TextDecoder */
|
|
7084
|
+
|
|
7082
7085
|
const CP437 = "\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split("");
|
|
7086
|
+
const VALID_CP437 = CP437.length == 256;
|
|
7083
7087
|
|
|
7084
|
-
var decodeCP437 = stringValue => {
|
|
7085
|
-
|
|
7086
|
-
|
|
7087
|
-
|
|
7088
|
+
var decodeCP437 = (stringValue) => {
|
|
7089
|
+
if (VALID_CP437) {
|
|
7090
|
+
let result = "";
|
|
7091
|
+
for (let indexCharacter = 0; indexCharacter < stringValue.length; indexCharacter++) {
|
|
7092
|
+
result += CP437[stringValue[indexCharacter]];
|
|
7093
|
+
}
|
|
7094
|
+
return result;
|
|
7095
|
+
} else {
|
|
7096
|
+
return new TextDecoder().decode(stringValue);
|
|
7088
7097
|
}
|
|
7089
|
-
return result;
|
|
7090
7098
|
};
|
|
7091
7099
|
|
|
7092
7100
|
/*
|
|
@@ -7389,6 +7397,7 @@
|
|
|
7389
7397
|
bitFlag,
|
|
7390
7398
|
signature,
|
|
7391
7399
|
rawLastModDate,
|
|
7400
|
+
uncompressedSize,
|
|
7392
7401
|
compressedSize
|
|
7393
7402
|
} = zipEntry;
|
|
7394
7403
|
const localDirectory = zipEntry.localDirectory = {};
|
|
@@ -7429,7 +7438,7 @@
|
|
|
7429
7438
|
readable.size = size;
|
|
7430
7439
|
const { writable } = writer;
|
|
7431
7440
|
const signal = getOptionValue$1(zipEntry, options, "signal");
|
|
7432
|
-
await initStream(writer);
|
|
7441
|
+
await initStream(writer, uncompressedSize);
|
|
7433
7442
|
const { onstart, onprogress, onend } = options;
|
|
7434
7443
|
const workerOptions = {
|
|
7435
7444
|
options: {
|