Skip to content
On this page

getFileType ​

判断上传的文件类型

引入方式 ​

ESM ​

javascript
import { getFileType } from "tool-assistant;

示例 ​

javascript
import { getFileType } from "tool-assistant";

const file = {
  name: 'example.shp' // 文件的完整文件名
};

const fileType = getFileType(file);
console.log(fileType); // 输出: shapefile

Released under the MIT License.