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

Function wrapAsync

out/cli.cjs:72768–72787  ·  view source on GitHub ↗
(asyncExecutor)

Source from the content-addressed store, hash-verified

72766 options.protocol = proxy.protocol.includes(":") ? proxy.protocol : `${proxy.protocol}:`;
72767 }
72768 }
72769 options.beforeRedirects.proxy = function beforeRedirect(redirectOptions) {
72770 setProxy(redirectOptions, configProxy, redirectOptions.href);
72771 };
72772}
72773var isHttpAdapterSupported = typeof process !== "undefined" && utils_default.kindOf(process) === "process";
72774var wrapAsync = (asyncExecutor) => {
72775 return new Promise((resolve, reject) => {
72776 let onDone;
72777 let isDone;
72778 const done = (value, isRejected) => {
72779 if (isDone) return;
72780 isDone = true;
72781 onDone && onDone(value, isRejected);
72782 };
72783 const _resolve = (value) => {
72784 done(value);
72785 resolve(value);
72786 };
72787 const _reject = (reason) => {
72788 done(reason, true);
72789 reject(reason);
72790 };

Callers 1

cli.cjsFile · 0.85

Calls 1

catchMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…