Files
lemma/app/src/utils/fileHelpers.ts
2025-04-04 19:23:31 +02:00

11 lines
378 B
TypeScript

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