mirror of
https://github.com/lordmathis/lemma.git
synced 2025-11-06 07:54:22 +00:00
Migrate utils to ts
This commit is contained in:
10
app/src/utils/fileHelpers.ts
Normal file
10
app/src/utils/fileHelpers.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { IMAGE_EXTENSIONS } from '../types/file';
|
||||
|
||||
/**
|
||||
* Checks if the given file path has an image extension.
|
||||
* @param filePath - The file path to check.
|
||||
* @returns True if the file path has an image extension, false otherwise.
|
||||
*/
|
||||
export const isImageFile = (filePath: string): boolean => {
|
||||
return IMAGE_EXTENSIONS.some((ext) => filePath.toLowerCase().endsWith(ext));
|
||||
};
|
||||
Reference in New Issue
Block a user