MCPcopy Create free account
hub / github.com/nodejs/node / wrapHandler

Method wrapHandler

deps/undici/undici.js:10310–10318  ·  view source on GitHub ↗
(handler)

Source from the content-addressed store, hash-verified

10308 this.#dispatcher = dispatcher;
10309 }
10310 static wrapHandler(handler) {
10311 if (!handler || typeof handler !== "object") {
10312 throw new InvalidArgumentError("handler must be an object");
10313 }
10314 if (typeof handler.onRequestStart === "function") {
10315 return handler;
10316 }
10317 return new LegacyHandlerWrapper(handler);
10318 }
10319 dispatch(opts, handler) {
10320 if (opts.allowH2 !== false) {
10321 opts = { ...opts, allowH2: false };

Callers 1

dispatchMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected