@push.rocks/smartarchive 5.0.0 → 5.0.1
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_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/classes.gziptools.d.ts +4 -0
- package/dist_ts/classes.gziptools.js +9 -18
- package/dist_ts/classes.smartarchive.d.ts +148 -51
- package/dist_ts/classes.smartarchive.js +450 -214
- package/dist_ts/classes.ziptools.js +20 -34
- package/dist_ts/interfaces.d.ts +4 -0
- package/package.json +1 -1
- package/readme.hints.md +69 -23
- package/readme.md +360 -274
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/classes.gziptools.ts +8 -13
- package/ts/classes.smartarchive.ts +506 -232
- package/ts/classes.ziptools.ts +18 -31
- package/ts/interfaces.ts +5 -0
package/ts/classes.ziptools.ts
CHANGED
|
@@ -100,17 +100,14 @@ export class ZipCompressionStream extends plugins.stream.Duplex {
|
|
|
100
100
|
filesObj[name] = options ? [data, options] : data;
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
});
|
|
103
|
+
// Use sync version for Deno compatibility (fflate async uses Web Workers)
|
|
104
|
+
try {
|
|
105
|
+
const result = plugins.fflate.zipSync(filesObj);
|
|
106
|
+
this.push(Buffer.from(result));
|
|
107
|
+
this.push(null);
|
|
108
|
+
} catch (err) {
|
|
109
|
+
throw err;
|
|
110
|
+
}
|
|
114
111
|
}
|
|
115
112
|
|
|
116
113
|
_read(): void {
|
|
@@ -179,31 +176,21 @@ export class ZipTools {
|
|
|
179
176
|
}
|
|
180
177
|
}
|
|
181
178
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
else resolve(Buffer.from(result));
|
|
186
|
-
});
|
|
187
|
-
});
|
|
179
|
+
// Use sync version for Deno compatibility (fflate async uses Web Workers)
|
|
180
|
+
const result = plugins.fflate.zipSync(filesObj);
|
|
181
|
+
return Buffer.from(result);
|
|
188
182
|
}
|
|
189
183
|
|
|
190
184
|
/**
|
|
191
185
|
* Extract a ZIP buffer to an array of entries
|
|
192
186
|
*/
|
|
193
187
|
public async extractZip(data: Buffer): Promise<Array<{ path: string; content: Buffer }>> {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
const entries: Array<{ path: string; content: Buffer }> = [];
|
|
202
|
-
for (const [path, content] of Object.entries(result)) {
|
|
203
|
-
entries.push({ path, content: Buffer.from(content) });
|
|
204
|
-
}
|
|
205
|
-
resolve(entries);
|
|
206
|
-
});
|
|
207
|
-
});
|
|
188
|
+
// Use sync version for Deno compatibility (fflate async uses Web Workers)
|
|
189
|
+
const result = plugins.fflate.unzipSync(data);
|
|
190
|
+
const entries: Array<{ path: string; content: Buffer }> = [];
|
|
191
|
+
for (const [path, content] of Object.entries(result)) {
|
|
192
|
+
entries.push({ path, content: Buffer.from(content) });
|
|
193
|
+
}
|
|
194
|
+
return entries;
|
|
208
195
|
}
|
|
209
196
|
}
|