@nxtedition/nxt-undici 7.3.24 → 7.3.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +9 -10
- package/lib/request.js +2 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -180,14 +180,13 @@ export function dispatch(dispatcher, opts, handler) {
|
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
export function request(urlOrOpts, opts) {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
)
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
)
|
|
183
|
+
const opts2 =
|
|
184
|
+
typeof urlOrOpts === 'object' && urlOrOpts != null && opts == null ? urlOrOpts : opts
|
|
185
|
+
const dispatcher =
|
|
186
|
+
opts2?.dispatch ??
|
|
187
|
+
opts2?.dispatcher ??
|
|
188
|
+
globalThis.__nxt_undici_dispatcher ??
|
|
189
|
+
undici.getGlobalDispatcher()
|
|
190
|
+
|
|
191
|
+
return _request(wrapDispatch(dispatcher), urlOrOpts, opts)
|
|
193
192
|
}
|
package/lib/request.js
CHANGED
|
@@ -146,8 +146,9 @@ export class RequestHandler {
|
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
export function request(dispatch, urlOrOpts,
|
|
149
|
+
export function request(dispatch, urlOrOpts, optsOrNully) {
|
|
150
150
|
let url = urlOrOpts
|
|
151
|
+
let opts = optsOrNully
|
|
151
152
|
|
|
152
153
|
if (typeof url === 'object' && url != null && opts == null) {
|
|
153
154
|
opts = url
|