@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.
@@ -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
  }
@@ -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
@@ -3,7 +3,7 @@
3
3
  "description": "A JavaScript library to zip and unzip files in the browser, Deno and Node.js",
4
4
  "author": "Gildas Lormeau",
5
5
  "license": "BSD-3-Clause",
6
- "version": "2.7.27",
6
+ "version": "2.7.29",
7
7
  "type": "module",
8
8
  "keywords": [
9
9
  "zip",