code: function _withPlugins(fn) {
    return function() {
      const args = Array.from(arguments);
      const opts = args[1] || {};
      args[1] = Object.assign({}, opts, {
        plugins: loadPlugins(opts.plugins, opts.pluginSearchDirs)
      });
      return fn.apply(null, args);
    };
  }
docs: Luckily `opts` is always the 2nd argument