generateFilter = (opts, parentDir, eventsHandler) => {
  const filter = {
    glob: [],
    plugins: satinize(opts.use, eventsHandler)
  };

  const addParentPath = glob => {
    return (typeof parentDir !== 'undefined' ? `${parentDir}/` : '') + glob;
  };

  const dirStr = path.resolve(addParentPath(opts.dir || ''));
  if (Array.isArray(opts.glob)) {
    filter.glob = opts.glob.map(str => addParentPath(str));
  } else if (typeof opts.glob === 'string') {
    filter.glob = [addParentPath(opts.glob)];
  } else {
    filter.glob = [`${dirStr}/**/*.*`];
  }

  return filter;
}
Generate a filter
@param {object} opts
@param {string} parentDir
@param {EventsHandler} eventsHandler