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

Method buildDispatch

deps/undici/src/lib/handler/redirect-handler.js:12–19  ·  view source on GitHub ↗
(dispatcher, maxRedirections)

Source from the content-addressed store, hash-verified

10
11class RedirectHandler {
12 static buildDispatch (dispatcher, maxRedirections) {
13 if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {
14 throw new InvalidArgumentError('maxRedirections must be a positive number')
15 }
16
17 const dispatch = dispatcher.dispatch.bind(dispatcher)
18 return (opts, originalHandler) => dispatch(opts, new RedirectHandler(dispatch, maxRedirections, opts, originalHandler))
19 }
20
21 constructor (dispatch, maxRedirections, opts, handler) {
22 if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {

Callers

nothing calls this directly

Calls 2

dispatchFunction · 0.50
bindMethod · 0.45

Tested by

no test coverage detected