Validate the arguments that are given to `catchAndMatch`.
Return an Error when one of these arguments is not of an expected type.
@param {Function} fn
@param {Function|undefined} cb
@param {Object} matcher
@return {Promise}
function isIllegalArguments(_ref) {
    var fn = _ref.fn;
    var cb = _ref.cb;
    var matcher = _ref.matcher;

    if (typeof fn !== 'function') {
      return Promise.reject(new Error('Expected fn to be a Function'));
    }
    if (typeof cb !== 'undefined' && typeof cb !== 'function') {
      return Promise.reject(new Error('Expected cb to be a Function'));
    }
    if (!(matcher instanceof RegExp) && ['function', 'string'].indexOf(typeof matcher === 'undefined' ? 'undefined' : _typeof(matcher)) === -1 && matcher.constructor !== Error.constructor) {
      return Promise.reject(new Error(UNRECOGNISED_MATCHER_ERR));
    }
    return Promise.resolve();
  }