MCPcopy Create free account
hub / github.com/xerrors/Yuxi / getDisplayFileName

Function getDisplayFileName

web/src/utils/file_utils.js:31–35  ·  view source on GitHub ↗
(pathOrName, fallback = '文件')

Source from the content-addressed store, hash-verified

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

Callers 2

getMentionDisplayLabelFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected