fix(core): update

This commit is contained in:
2024-03-17 00:29:42 +01:00
parent 25e847a9ea
commit d53c46fa82
7 changed files with 809 additions and 1570 deletions

View File

@@ -36,6 +36,8 @@ export class ArchiveAnalyzer {
switch (mimeTypeArg) {
case 'application/gzip':
return this.smartArchiveRef.gzipTools.getDecompressionStream();
case 'application/zip':
return this.smartArchiveRef.zipTools.getDecompressionStream();
case 'application/x-bzip2':
return await this.smartArchiveRef.bzip2Tools.getDecompressionStream(); // replace with your own bzip2 decompression stream
case 'application/x-tar':
@@ -56,6 +58,9 @@ export class ArchiveAnalyzer {
firstRun = false;
const fileType = await plugins.fileType.fileTypeFromBuffer(chunkArg);
const decompressionStream = await this.getDecompressionStream(fileType?.mime as any);
/**
* analyzed stream emits once with this object
*/
const result: IAnalyzedResult = {
fileType,
isArchive: await this.mimeTypeIsArchive(fileType?.mime),