@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 CHANGED
@@ -180,14 +180,13 @@ export function dispatch(dispatcher, opts, handler) {
180
180
  }
181
181
 
182
182
  export function request(urlOrOpts, opts) {
183
- return _request(
184
- wrapDispatch(
185
- opts?.dispatch ??
186
- opts?.dispatcher ??
187
- globalThis.__nxt_undici_dispatcher ??
188
- undici.getGlobalDispatcher(),
189
- ),
190
- urlOrOpts,
191
- opts,
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, opts) {
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/nxt-undici",
3
- "version": "7.3.24",
3
+ "version": "7.3.25",
4
4
  "license": "MIT",
5
5
  "author": "Robert Nagy <robert.nagy@boffins.se>",
6
6
  "main": "lib/index.js",