code: function withPlugins(fn) {
    return function() {
      const args = Array.from(arguments);
      let plugins = (args[1] && args[1].plugins) || [];
      if (!isArray(plugins)) {
        plugins = Object.values(plugins);
      }
      args[1] = Object.assign({}, args[1], {
        plugins: internalPlugins.concat(plugins)
      });
      return fn.apply(null, args);
    };
  }
docs: Luckily `opts` is always the 2nd argument