From b2efef3bb1542ad988c32e11da3968900a3df7d5 Mon Sep 17 00:00:00 2001 From: Adhityan K V Date: Thu, 13 Jun 2024 22:28:19 +0200 Subject: [PATCH] with working patched mmagic --- package-lock.json | 8 ++++---- package.json | 2 +- src/util/mime.ts | 2 ++ 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index ab4d4a83..78843873 100644 --- a/package-lock.json +++ b/package-lock.json @@ -28,7 +28,7 @@ "mime": "^4.0.3", "office-text-extractor": "^3.0.3", "sitemapper": "^3.1.8", - "stream-mmmagic-patched": "^2.4.1", + "stream-mmmagic-patched": "^2.4.2", "usetube": "^2.0.2", "uuid": "^10.0.0", "youtube-transcript": "^1.2.1" @@ -12278,9 +12278,9 @@ "devOptional": true }, "node_modules/stream-mmmagic-patched": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/stream-mmmagic-patched/-/stream-mmmagic-patched-2.4.1.tgz", - "integrity": "sha512-P5Jjlr5PXVIOyOj81unL7zGNm0V3hXOFBTroJP4gUfUacNoEMl6pAlAmZDRLNz6t/M1rw6eFlP2dDYddjHqgzA==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/stream-mmmagic-patched/-/stream-mmmagic-patched-2.4.2.tgz", + "integrity": "sha512-tiDdXEqTNCqA0sIGx3ZAF9dLk8vTRPMgFfwL5yFI5B/nPkXqXf/TSKD/ZTopKw192tpzjKKo4EnF/3XvclpSvQ==", "dependencies": { "buffer-peek-stream": "^1.1.0", "mmmagic-patched": "^0.5.5" diff --git a/package.json b/package.json index 2d65b6e5..a39d4a25 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ "mime": "^4.0.3", "office-text-extractor": "^3.0.3", "sitemapper": "^3.1.8", - "stream-mmmagic-patched": "^2.4.1", + "stream-mmmagic-patched": "^2.4.2", "usetube": "^2.0.2", "uuid": "^10.0.0", "youtube-transcript": "^1.2.1" diff --git a/src/util/mime.ts b/src/util/mime.ts index dd53b94a..4a88a794 100644 --- a/src/util/mime.ts +++ b/src/util/mime.ts @@ -28,6 +28,8 @@ export async function createLoaderFromMimeType(loader: string, mimeType: string) createDebugMessages('embedjs:createLoaderFromMimeType')(`Fine type for '${loader}' is '${fineType}'`); if (fineType === 'text/csv') return new CsvLoader({ filePathOrUrl: loader }); else return new TextLoader({ text: loader }); + case 'application/csv': + return new CsvLoader({ filePathOrUrl: loader }); case 'text/html': return new WebLoader({ urlOrContent: loader }); case 'text/xml':