diff --git a/package.json b/package.json index d8d8549f..efebfe1a 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ "debug": "^4.3.4", "eventemitter3": "^5.0.0", "fast-xml-parser": "^4.4.1", - "file-type": "^16.5.4", + "file-type": "^20.4.1", "follow-redirects": "^1.15.2", "isutf8": "^4.0.0", "jsonschema": "^1.4.1", diff --git a/src/lib/utils/index.ts b/src/lib/utils/index.ts index 939fc913..7e85dce9 100644 --- a/src/lib/utils/index.ts +++ b/src/lib/utils/index.ts @@ -18,7 +18,7 @@ import { Session } from '../client'; import { Hosts } from './../../config'; import { ExtensionsMap } from './extensions'; -import { fromBuffer } from 'file-type'; +import * as FileType from 'file-type'; import isutf8 from 'isutf8'; /** @@ -105,7 +105,7 @@ export const getMimetype = async(file: Uint8Array | Buffer, name?: string): Prom let type; try { - type = await fromBuffer(file); + type = await FileType.fileTypeFromBuffer(file); } catch(e) { console.warn("An exception occurred while processing the buffer:", e.message); }