MCPcopy Index your code
hub / github.com/di-sukharev/opencommit / composeSignals

Function composeSignals

out/cli.cjs:73491–73523  ·  view source on GitHub ↗
(signals, timeout)

Source from the content-addressed store, hash-verified

73489 reject(new AxiosError_default("Unsupported protocol " + protocol + ":", AxiosError_default.ERR_BAD_REQUEST, config8));
73490 return;
73491 }
73492 request3.send(requestData || null);
73493 });
73494};
73495
73496// node_modules/axios/lib/helpers/composeSignals.js
73497var composeSignals = (signals, timeout) => {
73498 const { length } = signals = signals ? signals.filter(Boolean) : [];
73499 if (timeout || length) {
73500 let controller = new AbortController();
73501 let aborted;
73502 const onabort = function(reason) {
73503 if (!aborted) {
73504 aborted = true;
73505 unsubscribe();
73506 const err = reason instanceof Error ? reason : this.reason;
73507 controller.abort(err instanceof AxiosError_default ? err : new CanceledError_default(err instanceof Error ? err.message : err));
73508 }
73509 };
73510 let timer = timeout && setTimeout(() => {
73511 timer = null;
73512 onabort(new AxiosError_default(`timeout ${timeout} of ms exceeded`, AxiosError_default.ETIMEDOUT));
73513 }, timeout);
73514 const unsubscribe = () => {
73515 if (signals) {
73516 timer && clearTimeout(timer);
73517 timer = null;
73518 signals.forEach((signal2) => {
73519 signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort);
73520 });
73521 signals = null;
73522 }
73523 };
73524 signals.forEach((signal2) => signal2.addEventListener("abort", onabort));
73525 const { signal } = controller;
73526 signal.unsubscribe = () => utils_default.asap(unsubscribe);

Callers

nothing calls this directly

Calls 4

setTimeoutFunction · 0.85
onabortFunction · 0.85
filterMethod · 0.80
forEachMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…