function callOnHub(method) {
    var args = [];
    for (var _i = 1; _i < arguments.length; _i++) {
        args[_i - 1] = arguments[_i];
    }
    var hub = getCurrentHub();
    if (hub && hub[method]) {
        // eslint-disable-next-line @typescript-eslint/no-explicit-any
        return hub[method].apply(hub, __spread$3(args));
    }
    throw new Error("No hub defined or " + method + " was not found on the hub, please open a bug report.");
}
This calls a function on the current hub.
@param method function to call on hub.
@param args to pass to function.