import _types from '../types.json';
var types = _types;
var map = {};

var _arr = Object.keys(types);

for (var _i = 0; _i < _arr.length; _i++) {
  var _key = _arr[_i];
  map[_key] = new RegExp(types[_key], 'i');
}

export default function validateType(name, mimeType) {
  if (!map[name]) {
    console.error("".concat(name, " is not exist in validateType "));
    return false;
  }

  return map[name].test(mimeType);
}