forked from mirror/misskey
refactor
This commit is contained in:
parent
89a532eeac
commit
3692c9eb64
@ -99,7 +99,10 @@ export async function getFileInfo(path: string): Promise<FileInfo> {
|
|||||||
/**
|
/**
|
||||||
* Detect MIME Type and extension
|
* Detect MIME Type and extension
|
||||||
*/
|
*/
|
||||||
export async function detectType(path: string) {
|
export async function detectType(path: string): Promise<{
|
||||||
|
mime: string;
|
||||||
|
ext: string | null;
|
||||||
|
}> {
|
||||||
// Check 0 byte
|
// Check 0 byte
|
||||||
const fileSize = await getFileSize(path);
|
const fileSize = await getFileSize(path);
|
||||||
if (fileSize === 0) {
|
if (fileSize === 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user