MCPcopy Index your code
hub / github.com/nodejs/node / compose

Method compose

deps/undici/undici.js:592–610  ·  view source on GitHub ↗
(...args)

Source from the content-addressed store, hash-verified

590 throw new Error("not implemented");
591 }
592 compose(...args) {
593 const interceptors = Array.isArray(args[0]) ? args[0] : args;
594 let dispatch = this.dispatch.bind(this);
595 for (const interceptor of interceptors) {
596 if (interceptor == null) {
597 continue;
598 }
599 if (typeof interceptor !== "function") {
600 throw new TypeError(`invalid interceptor, expected function received ${typeof interceptor}`);
601 }
602 dispatch = interceptor(dispatch);
603 if (dispatch == null || typeof dispatch !== "function" || dispatch.length !== 2) {
604 throw new TypeError("invalid interceptor");
605 }
606 }
607 return new Proxy(this, {
608 get: /* @__PURE__ */ __name((target, key) => key === "dispatch" ? dispatch : target[key], "get")
609 });
610 }
611 };
612 module2.exports = Dispatcher2;
613 }

Callers 8

mainFunction · 0.45
runTestsFunction · 0.45
runner.mjsFile · 0.45

Calls 2

__nameFunction · 0.85
bindMethod · 0.45

Tested by

no test coverage detected