'use strict';

function getFileType(file, file64) {
  if (file.type) {
    return file.type;
  }
  if (file64) {
    const regex = /^data:([a-z]+\/[a-z]+);/;
    const typeFromEncoded = regex.exec(file64);
    if (typeFromEncoded?.[1]) {
      return typeFromEncoded[1];
    }
  }
  return '';
}

exports.getFileType = getFileType;
//# sourceMappingURL=getFileType.js.map
