@zip.js/zip.js 2.6.68 → 2.6.69
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 +16 -6
- package/dist/zip-fs-full.min.js +1 -1
- package/dist/zip-fs.js +16 -6
- package/dist/zip-fs.min.js +1 -1
- package/index.cjs +16 -6
- package/index.d.ts +4 -0
- package/lib/core/zip-fs-core.js +16 -6
- package/package.json +1 -1
package/index.d.ts
CHANGED
package/lib/core/zip-fs-core.js
CHANGED
|
@@ -125,6 +125,10 @@ class ZipFileEntry extends ZipEntry {
|
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
+
clone() {
|
|
129
|
+
return new ZipFileEntry(this.fs, this.name, this);
|
|
130
|
+
}
|
|
131
|
+
|
|
128
132
|
async getData(writer, options = {}) {
|
|
129
133
|
const zipEntry = this;
|
|
130
134
|
if (!writer || (writer.constructor == zipEntry.Writer && zipEntry.data)) {
|
|
@@ -212,6 +216,10 @@ class ZipDirectoryEntry extends ZipEntry {
|
|
|
212
216
|
this.directory = true;
|
|
213
217
|
}
|
|
214
218
|
|
|
219
|
+
clone() {
|
|
220
|
+
return new ZipDirectoryEntry(this.fs, this.name);
|
|
221
|
+
}
|
|
222
|
+
|
|
215
223
|
addDirectory(name) {
|
|
216
224
|
return addChild(this, name, null, true);
|
|
217
225
|
}
|
|
@@ -533,12 +541,14 @@ async function initReaders(entry) {
|
|
|
533
541
|
}
|
|
534
542
|
|
|
535
543
|
function detach(entry) {
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
544
|
+
if (entry.parent) {
|
|
545
|
+
const children = entry.parent.children;
|
|
546
|
+
children.forEach((child, index) => {
|
|
547
|
+
if (child.id == entry.id) {
|
|
548
|
+
children.splice(index, 1);
|
|
549
|
+
}
|
|
550
|
+
});
|
|
551
|
+
}
|
|
542
552
|
}
|
|
543
553
|
|
|
544
554
|
async function exportZip(zipWriter, entry, totalSize, options) {
|
package/package.json
CHANGED