function wrapGlob(glob, opts) {
  var prefix = opts && !opts.contains ? '^' : '';
  var after = opts && !opts.contains ? '$' : '';
  glob = '(?:' + glob + ')' + after;

  if (opts && opts.negate) {
    return prefix + ('(?!^' + glob + ').*$');
  }

  return prefix + glob;
}
Create the regex to do the matching. If the leading
character in the `glob` is `!` a negation regex is returned.

@param {String} `glob`
@param {Boolean} `negate`