code: function pipe(funcs) {
    return function pipeRewire(config) {
      const args = Array.prototype.slice.call(arguments, 1);
      (funcs || []).forEach(func => {
        if (func && typeof func === 'function') {
          // slice the first argument "config"
          config = func.apply(this, [config].concat(args));
        }
      });
      return config;
    };
  }
docs: pipe rewire do not use recursion here to prevent maximum call stack