@push.rocks/smartarchive 4.0.6 → 4.0.7
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/bzip2/bititerator.d.ts +2 -0
- package/dist_ts/bzip2/bititerator.js +43 -0
- package/dist_ts/bzip2/bzip2.d.ts +14 -0
- package/dist_ts/bzip2/bzip2.js +353 -0
- package/dist_ts/bzip2/index.d.ts +2 -0
- package/dist_ts/bzip2/index.js +83 -0
- package/dist_ts/classes.archiveanalyzer.js +4 -4
- package/dist_ts/classes.bzip2tools.d.ts +1 -9
- package/dist_ts/classes.bzip2tools.js +3 -28
- package/dist_ts/classes.smartarchive.js +6 -2
- package/dist_ts/plugins.d.ts +1 -2
- package/dist_ts/plugins.js +2 -3
- package/license +5 -1
- package/package.json +2 -3
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/bzip2/bititerator.ts +41 -0
- package/ts/bzip2/bzip2.ts +335 -0
- package/ts/bzip2/index.ts +84 -0
- package/ts/classes.archiveanalyzer.ts +4 -4
- package/ts/classes.bzip2tools.ts +2 -31
- package/ts/classes.smartarchive.ts +5 -1
- package/ts/plugins.ts +1 -2
|
@@ -80,6 +80,7 @@ export class SmartArchive {
|
|
|
80
80
|
streamFileStream.pipe(new plugins.smartstream.SmartDuplex({
|
|
81
81
|
objectMode: true,
|
|
82
82
|
writeFunction: async (chunkArg: plugins.smartfile.StreamFile, streamtools) => {
|
|
83
|
+
const done = plugins.smartpromise.defer<void>();
|
|
83
84
|
console.log(chunkArg.relativeFilePath);
|
|
84
85
|
const streamFile = chunkArg;
|
|
85
86
|
const readStream = await streamFile.createReadStream();
|
|
@@ -88,6 +89,10 @@ export class SmartArchive {
|
|
|
88
89
|
await plugins.smartfile.fs.ensureDir(plugins.path.dirname(writePath));
|
|
89
90
|
const writeStream = plugins.smartfile.fsStream.createWriteStream(writePath);
|
|
90
91
|
readStream.pipe(writeStream);
|
|
92
|
+
writeStream.on('finish', () => {
|
|
93
|
+
done.resolve();
|
|
94
|
+
})
|
|
95
|
+
await done.promise;
|
|
91
96
|
},
|
|
92
97
|
finalFunction: async () => {
|
|
93
98
|
done.resolve();
|
|
@@ -117,7 +122,6 @@ export class SmartArchive {
|
|
|
117
122
|
stream.on('end', function () {
|
|
118
123
|
next(); // ready for next entry
|
|
119
124
|
});
|
|
120
|
-
stream.resume(); // just auto drain the stream
|
|
121
125
|
}
|
|
122
126
|
);
|
|
123
127
|
tarStream.on('finish', function () {
|
package/ts/plugins.ts
CHANGED
|
@@ -20,6 +20,5 @@ export { smartfile, smartpath, smartpromise, smartrequest, smartunique, smartstr
|
|
|
20
20
|
import * as fileType from 'file-type';
|
|
21
21
|
import * as fflate from 'fflate';
|
|
22
22
|
import tarStream from 'tar-stream';
|
|
23
|
-
import unbzip2Stream from 'unbzip2-stream';
|
|
24
23
|
|
|
25
|
-
export { fileType, fflate, tarStream
|
|
24
|
+
export { fileType, fflate, tarStream };
|