import { getFileType } from '../getFileType/getFileType.mjs';

function isTypeValid(file, rule, file64) {
  if (!rule) {
    return false;
  }
  const allowedTypes = rule.replace(/\s/g, '').split(',');
  const fileType = getFileType(file, file64);
  if (rule === '*' || allowedTypes.includes(fileType)) {
    return true;
  }
  return allowedTypes.some(type => {
    const [typeAllowed, extensionAllowed] = type.split('/');
    return extensionAllowed === '*' && fileType.includes(typeAllowed);
  });
}

export { isTypeValid };
//# sourceMappingURL=isTypeValid.mjs.map
