MCPcopy Create free account
hub / github.com/Rfym21/Qwen2API / getSimpleFileType

Function getSimpleFileType

src/utils/upload.js:43–54  ·  view source on GitHub ↗
(mimeType)

Source from the content-addressed store, hash-verified

41 * 从完整MIME类型获取简化的文件类型
42 * @param {string} mimeType - 完整的MIME类型
43 * @returns {string} 简化文件类型
44 */
45const getSimpleFileType = (mimeType) => {
46 if (!mimeType) return 'file'
47
48 const mainType = mimeType.split('/')[0].toLowerCase()
49
50 // 检查是否为支持的主要类型
51 if (Object.keys(SUPPORTED_TYPES).includes(mainType)) {
52 return mainType
53 }
54
55 return 'file'
56}
57

Callers 1

uploadFileToQwenOssFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected