function wrapMiddlewareArgs(args, method) {
  return args.map((arg) => {
    if (typeof arg === 'function') {
      return wrap(arg, method);
    }

    if (Array.isArray(arg)) {
      return arg.map((a) => {
        if (typeof a === 'function') {
          return wrap(a, method);
        }
        return a;
      });
    }

    return arg;
  });
}
Takes all the function arguments passed to the original `app` or `router` method, eg. `app.use` or `router.use`
and wraps every function, as well as array of functions with a call to our `wrap` method.
We have to take care of the arrays as well as iterate over all of the arguments,
as `app.use` can accept middlewares in few various forms.

app.use([<path>], <fn>)
app.use([<path>], <fn>, ...<fn>)
app.use([<path>], ...<fn>[])