MCPcopy
hub / github.com/di-sukharev/opencommit / upgrade

Function upgrade

out/cli.cjs:56959–56981  ·  view source on GitHub ↗
(opts, callback)

Source from the content-addressed store, hash-verified

56957 if (callback) {
56958 this.callback = null;
56959 queueMicrotask(() => {
56960 this.runInAsyncScope(callback, null, err, { opaque });
56961 });
56962 }
56963 }
56964 };
56965 function upgrade(opts, callback) {
56966 if (callback === void 0) {
56967 return new Promise((resolve, reject) => {
56968 upgrade.call(this, opts, (err, data) => {
56969 return err ? reject(err) : resolve(data);
56970 });
56971 });
56972 }
56973 try {
56974 const upgradeHandler = new UpgradeHandler(opts, callback);
56975 this.dispatch({
56976 ...opts,
56977 method: opts.method || "GET",
56978 upgrade: opts.protocol || "Websocket"
56979 }, upgradeHandler);
56980 } catch (err) {
56981 if (typeof callback !== "function") {
56982 throw err;
56983 }
56984 const opaque = opts && opts.opaque;

Callers

nothing calls this directly

Calls 3

rejectFunction · 0.85
callbackFunction · 0.85
dispatchMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…