@zip.js/zip.js 2.7.27 → 2.7.29
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/dist/zip-fs-full.js +10 -3
- package/dist/zip-fs-full.min.js +1 -1
- package/dist/zip-fs.js +10 -3
- package/dist/zip-fs.min.js +1 -1
- package/dist/zip-full.js +3 -3
- package/dist/zip-full.min.js +1 -1
- package/dist/zip-no-worker-deflate.min.js +1 -1
- package/dist/zip-no-worker.min.js +1 -1
- package/dist/zip.js +3 -3
- package/dist/zip.min.js +1 -1
- package/index.cjs +10 -3
- package/index.min.js +1 -1
- package/lib/core/zip-fs-core.js +7 -0
- package/lib/core/zip-writer.js +3 -3
- package/package.json +1 -1
package/lib/core/zip-fs-core.js
CHANGED
|
@@ -433,6 +433,9 @@ class ZipDirectoryEntry extends ZipEntry {
|
|
|
433
433
|
|
|
434
434
|
async exportZip(writer, options) {
|
|
435
435
|
const zipEntry = this;
|
|
436
|
+
if (options.bufferedWrite === undefined) {
|
|
437
|
+
options.bufferedWrite = true;
|
|
438
|
+
}
|
|
436
439
|
await Promise.all([initReaders(zipEntry, options.readerOptions), initStream(writer)]);
|
|
437
440
|
const zipWriter = new ZipWriter(writer, options);
|
|
438
441
|
await exportZip(zipWriter, zipEntry, getTotalSize([zipEntry], "uncompressedSize"), options);
|
|
@@ -540,6 +543,10 @@ class FS {
|
|
|
540
543
|
return this.root.addData64URI(name, dataURI, options);
|
|
541
544
|
}
|
|
542
545
|
|
|
546
|
+
addUint8Array(name, array, options) {
|
|
547
|
+
return this.root.addUint8Array(name, array, options);
|
|
548
|
+
}
|
|
549
|
+
|
|
543
550
|
addHttpContent(name, url, options) {
|
|
544
551
|
return this.root.addHttpContent(name, url, options);
|
|
545
552
|
}
|
package/lib/core/zip-writer.js
CHANGED
|
@@ -384,6 +384,9 @@ async function getFileEntry(zipWriter, name, reader, entryInfo, options) {
|
|
|
384
384
|
await writeData(writable, signatureArray);
|
|
385
385
|
zipWriter.offset += 4;
|
|
386
386
|
}
|
|
387
|
+
if (usdz) {
|
|
388
|
+
appendExtraFieldUSDZ(entryInfo, zipWriter.offset - diskOffset);
|
|
389
|
+
}
|
|
387
390
|
if (!bufferedWrite) {
|
|
388
391
|
await lockPreviousFileEntry;
|
|
389
392
|
await skipDiskIfNeeded(writable);
|
|
@@ -391,9 +394,6 @@ async function getFileEntry(zipWriter, name, reader, entryInfo, options) {
|
|
|
391
394
|
const { diskNumber } = writer;
|
|
392
395
|
writingEntryData = true;
|
|
393
396
|
fileEntry.diskNumberStart = diskNumber;
|
|
394
|
-
if (usdz) {
|
|
395
|
-
appendExtraFieldUSDZ(entryInfo, zipWriter.offset - diskOffset);
|
|
396
|
-
}
|
|
397
397
|
fileEntry = await createFileEntry(reader, fileWriter, fileEntry, entryInfo, zipWriter.config, options);
|
|
398
398
|
writingEntryData = false;
|
|
399
399
|
files.set(name, fileEntry);
|
package/package.json
CHANGED