(mimeType)
| 41 | * 从完整MIME类型获取简化的文件类型 |
| 42 | * @param {string} mimeType - 完整的MIME类型 |
| 43 | * @returns {string} 简化文件类型 |
| 44 | */ |
| 45 | const 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 |
no outgoing calls
no test coverage detected