Skip to content

Commit 8836085

Browse files
authored
chore: replace mime with mime-types (#624)
Signed-off-by: Rui Chen <[email protected]>
1 parent 8646335 commit 8836085

File tree

4 files changed

+42
-20
lines changed

4 files changed

+42
-20
lines changed

dist/index.js

Lines changed: 16 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 22 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@
2626
"@octokit/plugin-retry": "^8.0.1",
2727
"@octokit/plugin-throttling": "^11.0.1",
2828
"glob": "^11.0.2",
29-
"mime": "^3.0.0"
29+
"mime-types": "^3.0.1"
3030
},
3131
"devDependencies": {
3232
"@types/glob": "^8.1.0",
3333
"@types/jest": "^29.5.14",
34-
"@types/mime": "^3.0.1",
34+
"@types/mime-types": "^3.0.1",
3535
"@types/node": "^22.15.21",
3636
"@vercel/ncc": "^0.38.3",
3737
"jest": "^29.3.1",

src/github.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { GitHub } from "@actions/github/lib/utils";
22
import { Config, isTag, releaseBody, alignAssetName } from "./util";
33
import { statSync } from "fs";
44
import { open } from "fs/promises";
5-
import { getType } from "mime";
5+
import { lookup } from "mime-types";
66
import { basename } from "path";
77

88
type GitHub = InstanceType<typeof GitHub>;
@@ -149,7 +149,7 @@ export const asset = (path: string): ReleaseAsset => {
149149
};
150150

151151
export const mimeOrDefault = (path: string): string => {
152-
return getType(path) || "application/octet-stream";
152+
return lookup(path) || "application/octet-stream";
153153
};
154154

155155
export const upload = async (

0 commit comments

Comments
 (0)