fix(core): update

This commit is contained in:
2023-11-07 04:19:54 +01:00
parent e3ab98751d
commit 32de8087ad
6 changed files with 37 additions and 21 deletions

View File

@@ -53,13 +53,13 @@ export class ArchiveAnalyzer {
readableObjectMode: true,
writeAndTransformFunction: async (chunkArg: Buffer, streamtools) => {
const fileType = await plugins.fileType.fileTypeFromBuffer(chunkArg);
const decompressionStream = this.getDecompressionStream(fileType.mime as any);
const decompressionStream = this.getDecompressionStream(fileType?.mime as any);
resultStream.push(chunkArg);
if (firstRun) {
firstRun = false;
const result: IAnalyzedResult = {
fileType,
isArchive: await this.mimeTypeIsArchive(fileType.mime),
isArchive: await this.mimeTypeIsArchive(fileType?.mime),
resultStream,
decompressionStream,
};
@@ -68,6 +68,10 @@ export class ArchiveAnalyzer {
return null;
}
},
finalFunction: async (tools) => {
resultStream.push(null);
return null;
}
});
return analyzerstream;
}