Improve getExtension func

This commit is contained in:
古大羊 2024-05-02 21:01:58 +08:00
parent 0434c79293
commit 5823f31e66

View File

@ -275,7 +275,7 @@ const open = () => {
const getExtension = (fileName: string): string => {
const lastDotIndex = fileName.lastIndexOf('.');
if (lastDotIndex === -1) {
return '';
return fileName;
}
return fileName.substring(lastDotIndex );
};