Update file language on renaming.

This commit is contained in:
muzam1l
2022-08-17 12:46:17 +05:30
parent 79bd5da3d2
commit 2c2bf59bcd
4 changed files with 28 additions and 18 deletions

View File

@@ -12,4 +12,10 @@ export const capitalize = (value?: string) => {
if (!value) return '';
return value[0].toLocaleUpperCase() + value.slice(1);
}
export const getFileExtention = (filename?: string): string | undefined => {
if (!filename) return
const ext = (filename.includes('.') && filename.split('.').pop()) || undefined
return ext
}