chore: replace mime with mime-types (#624)
Some checks are pending
main / build (push) Waiting to run

Signed-off-by: Rui Chen <rui@chenrui.dev>
This commit is contained in:
Rui Chen 2025-06-09 19:03:00 -04:00 committed by GitHub
parent 86463358d8
commit 8836085300
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 42 additions and 20 deletions

View file

@ -2,7 +2,7 @@ import { GitHub } from "@actions/github/lib/utils";
import { Config, isTag, releaseBody, alignAssetName } from "./util";
import { statSync } from "fs";
import { open } from "fs/promises";
import { getType } from "mime";
import { lookup } from "mime-types";
import { basename } from "path";
type GitHub = InstanceType<typeof GitHub>;
@ -149,7 +149,7 @@ export const asset = (path: string): ReleaseAsset => {
};
export const mimeOrDefault = (path: string): string => {
return getType(path) || "application/octet-stream";
return lookup(path) || "application/octet-stream";
};
export const upload = async (