Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
5d94efb9ee | |||
c978ca107b | |||
876c8ce9d8 | |||
7327bf1bd0 |
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@push.rocks/smartarchive",
|
||||
"version": "4.0.20",
|
||||
"version": "4.0.22",
|
||||
"description": "work with archives",
|
||||
"main": "dist_ts/index.js",
|
||||
"typings": "dist_ts/index.d.ts",
|
||||
|
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@push.rocks/smartarchive',
|
||||
version: '4.0.20',
|
||||
version: '4.0.22',
|
||||
description: 'work with archives'
|
||||
}
|
||||
|
@ -82,10 +82,10 @@ export class SmartArchive {
|
||||
streamFileStream.pipe(
|
||||
new plugins.smartstream.SmartDuplex({
|
||||
objectMode: true,
|
||||
writeFunction: async (chunkArg: plugins.smartfile.StreamFile, streamtools) => {
|
||||
writeFunction: async (streamFileArg: plugins.smartfile.StreamFile, streamtools) => {
|
||||
const done = plugins.smartpromise.defer<void>();
|
||||
console.log(chunkArg.relativeFilePath ? chunkArg.relativeFilePath : 'no relative path');
|
||||
const streamFile = chunkArg;
|
||||
console.log(streamFileArg.relativeFilePath ? streamFileArg.relativeFilePath : 'no relative path');
|
||||
const streamFile = streamFileArg;
|
||||
const readStream = await streamFile.createReadStream();
|
||||
await plugins.smartfile.fs.ensureDir(targetDir);
|
||||
const writePath = plugins.path.join(
|
||||
@ -141,6 +141,9 @@ export class SmartArchive {
|
||||
writeFunction: async (streamFileArg: plugins.smartfile.StreamFile, streamtools) => {
|
||||
streamFileIntake.push(streamFileArg);
|
||||
},
|
||||
finalFunction: async () => {
|
||||
streamFileIntake.signalEnd();
|
||||
}
|
||||
}));
|
||||
} else if (analyzedResultChunk.isArchive && analyzedResultChunk.decompressionStream) {
|
||||
analyzedResultChunk.resultStream
|
||||
|
@ -11,7 +11,7 @@ class DecompressZipTransform extends plugins.smartstream.SmartDuplex<ArrayBuffer
|
||||
if (final) {
|
||||
const streamFile = plugins.smartfile.StreamFile.fromBuffer(resultBuffer);
|
||||
streamFile.relativeFilePath = fileArg.name;
|
||||
this.streamtools.push(fileArg);
|
||||
this.streamtools.push(streamFile);
|
||||
}
|
||||
}
|
||||
fileArg.start();
|
||||
@ -26,7 +26,7 @@ class DecompressZipTransform extends plugins.smartstream.SmartDuplex<ArrayBuffer
|
||||
finalFunction: async () => {
|
||||
this.unzipper.push(Buffer.from(''), true);
|
||||
await plugins.smartdelay.delayFor(0);
|
||||
this.streamtools.push(null);
|
||||
await this.streamtools.push(null);
|
||||
}
|
||||
});
|
||||
this.unzipper.register(plugins.fflate.UnzipInflate);
|
||||
|
Reference in New Issue
Block a user