Skip to content

Commit

Permalink
Remove file-type dependency (#757)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yang-33 authored Mar 13, 2024
1 parent b962ab1 commit a81854d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 98 deletions.
3 changes: 1 addition & 2 deletions lib/http-axios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import axios, {
} from "axios";
import { Readable } from "node:stream";
import { HTTPError, ReadError, RequestError } from "./exceptions";
import * as fileType from "file-type";

const pkg = require("../package.json");

Expand Down Expand Up @@ -143,7 +142,7 @@ export default class HTTPClient {

const res = await this.instance.post(url, buffer, {
headers: {
"Content-Type": contentType || (await fileType.fromBuffer(buffer)).mime,
"Content-Type": contentType || "image/png",
"Content-Length": buffer.length,
},
});
Expand Down
101 changes: 7 additions & 94 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@
"@types/node": "^20.0.0"
},
"optionalDependencies": {
"axios": "^1.0.0",
"file-type": "^16.5.4"
"axios": "^1.0.0"
},
"devDependencies": {
"@types/express": "4.17.21",
Expand Down

0 comments on commit a81854d

Please sign in to comment.