import { MimeTypeRegistry } from '../../../../services/MimeTypeRegistry';
const getExtensionFromName = (filename) => {
    const lastDotIndex = filename.lastIndexOf('.');
    if (lastDotIndex < 0) {
        return '';
    }
    return filename.slice(lastDotIndex + 1).toLowerCase();
};
export const getFileMeta = (file) => {
    const extension = getExtensionFromName(file.name);
    if (file.type) {
        return {
            mimeType: file.type,
            extension,
        };
    }
    return {
        mimeType: MimeTypeRegistry.getInstance().getMimeTypeByExtension(extension) || '',
        extension,
    };
};
