export const validateFileExtension = (file, allowedFileTypes) => {
    const selectedFile = file.target?.files?.[0] ||
        file;
    const fileExtension = '.' + selectedFile?.name?.split('.')?.pop()?.toLowerCase();
    const fileType = selectedFile?.type;
    if (['.ipa', '.y4m', '.yml', '.md', '.pem', '.properties'].includes(fileExtension) &&
        Object.keys(allowedFileTypes)?.includes(fileExtension)) {
        return true;
    }
    return (allowedFileTypes[fileExtension] &&
        fileType === allowedFileTypes[fileExtension]);
};
export const validateZipFileExtension = (file) => {
    const selectedFile = file.target?.files?.[0] ||
        file;
    // List of valid MIME types
    const validMimeTypes = ['application/zip', 'application/x-zip-compressed'];
    // Validating the file extension and MIME type
    return (selectedFile &&
        validMimeTypes?.includes(selectedFile?.type) &&
        selectedFile?.name?.toLowerCase()?.endsWith('.zip'));
};
//# sourceMappingURL=validateFile.js.map