(pathOrName, fallback = '文件')
| 29 | } |
| 30 | |
| 31 | export const getDisplayFileName = (pathOrName, fallback = '文件') => { |
| 32 | const value = String(pathOrName || '').trim() |
| 33 | if (!value) return fallback |
| 34 | return value.split('/').pop() || value || fallback |
| 35 | } |
| 36 | |
| 37 | export const getFileExtensionLabel = (pathOrName) => { |
| 38 | const extension = getPreviewFileExtension(pathOrName).replace(/^\./, '') |
no outgoing calls
no test coverage detected