From d665164e160848c53b551a4caa73dc6a1d84d559 Mon Sep 17 00:00:00 2001 From: Edgard Date: Fri, 26 Nov 2021 08:40:28 -0300 Subject: [PATCH] fix: Reverted file-type update --- .github/dependabot.yml | 3 +++ package.json | 3 +-- src/chat/Chat.ts | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 47647da1f0..5e4234ac80 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -15,3 +15,6 @@ updates: - dependency-name: '@types/node' versions: - '>= 15.a' + - dependency-name: 'file-type' + versions: + - '>= 17.a' diff --git a/package.json b/package.json index 16979adac1..e1c6b835df 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,6 @@ "name": "@wppconnect/wa-js", "version": "1.0.14", "description": "WPPConnect/WA-JS is an open-source project with the aim of exporting functions from WhatsApp Web", - "main": "dist/wppconnect-wa.js", "types": "dist/index.d.ts", "exports": { ".": "./dist/wppconnect-wa.js" @@ -58,7 +57,7 @@ "eslint-plugin-import": "^2.25.3", "eslint-plugin-prettier": "^4.0.0", "eslint-plugin-simple-import-sort": "^7.0.0", - "file-type": "^17.0.0", + "file-type": "~16.5.3", "husky": "^7.0.4", "playwright-chromium": "^1.16.3", "prettier": "^2.5.0", diff --git a/src/chat/Chat.ts b/src/chat/Chat.ts index b998a7c961..0afbf9a918 100644 --- a/src/chat/Chat.ts +++ b/src/chat/Chat.ts @@ -809,7 +809,7 @@ export class Chat extends Emittery { ); if (!filename) { - const result = await FileType.fileTypeFromBuffer(buffer); + const result = await FileType.fromBuffer(buffer); if (result) { const baseType = result.mime.split('/')[0]; filename = `${baseType}.${result.ext}`;