初始化模版工程
This commit is contained in:
8
components/image-editor/utils/filename.ts
Normal file
8
components/image-editor/utils/filename.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
export function filename(path: string) {
|
||||
const fileName = path.split('/').pop()
|
||||
if (!fileName) return { name: '', extension: '' }
|
||||
const fileNames = fileName.split('.')
|
||||
const extension = fileNames.pop()
|
||||
const name = fileNames.join('.')
|
||||
return { name, extension }
|
||||
}
|
||||
Reference in New Issue
Block a user