function micromatch(files, patterns, opts) {
  if (!files || !patterns) return [];
  opts = opts || {};

  if (typeof opts.cache === 'undefined') {
    opts.cache = true;
  }

  if (!Array.isArray(patterns)) {
    return match(files, patterns, opts);
  }

  var len = patterns.length,
      i = 0;
  var omit = [],
      keep = [];

  while (len--) {
    var glob = patterns[i++];

    if (typeof glob === 'string' && glob.charCodeAt(0) === 33
    /* ! */
    ) {
        omit.push.apply(omit, match(files, glob.slice(1), opts));
      } else {
      keep.push.apply(keep, match(files, glob, opts));
    }
  }

  return utils.diff(keep, omit);
}
The main function. Pass an array of filepaths,
and a string or array of glob patterns

@param  {Array|String} `files`
@param  {Array|String} `patterns`
@param  {Object} `opts`
@return {Array} Array of matches