code: function onlyFunctions(middleware) {
    if (!middleware || !Array.isArray(middleware)) {
      return [];
    }
  
    return middleware.filter(function (fn) {
      return typeof fn === 'function';
    });
  }
docs: /*
  @private function onlyFunctions (middleware)
  Ensures that everything in the `middleware` Array
  is, in fact, a function.