Migrate utils to ts

This commit is contained in:
2025-04-04 19:23:31 +02:00
parent 49ecaac720
commit e4fb276cf7
12 changed files with 287 additions and 111 deletions

View 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));
};