UNPKG

aling

Version:

奇怪的组件库

6 lines (5 loc) 372 B
import mime from "mime"; export const getFileTye = (fileName) => { var _a, _b, _c, _d; return (_d = (_c = mime.getType(((_b = (_a = fileName.split(".")) === null || _a === void 0 ? void 0 : _a.slice(-1)) === null || _b === void 0 ? void 0 : _b[0]) || "image/png")) === null || _c === void 0 ? void 0 : _c.split("/")) === null || _d === void 0 ? void 0 : _d[0]; };