@nxtedition/nxt-undici 6.0.0 → 6.0.1

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.
@@ -161,7 +161,7 @@ export default () => (dispatch) => (opts, handler) => {
161
161
  try {
162
162
  handler.onConnect(abort)
163
163
  if (aborted) {
164
- return true
164
+ return
165
165
  }
166
166
 
167
167
  if (handler.onHeaders(statusCode, headers, resume) === false) {
@@ -169,7 +169,7 @@ export default () => (dispatch) => (opts, handler) => {
169
169
  }
170
170
 
171
171
  if (aborted) {
172
- return true
172
+ return
173
173
  }
174
174
 
175
175
  if (!paused) {
@@ -178,6 +178,4 @@ export default () => (dispatch) => (opts, handler) => {
178
178
  } catch (err) {
179
179
  abort(err)
180
180
  }
181
-
182
- return true
183
181
  }
@@ -24,6 +24,4 @@ export default () => (dispatch) => (opts, handler) => {
24
24
  } catch (err) {
25
25
  callback(err)
26
26
  }
27
-
28
- return true
29
27
  }
@@ -42,10 +42,10 @@ class Handler extends DecoratorHandler {
42
42
  proxyName: this.#opts.name,
43
43
  },
44
44
  (acc, key, val) => {
45
- acc.push(key, val)
45
+ acc[key] = val
46
46
  return acc
47
47
  },
48
- [],
48
+ {},
49
49
  ),
50
50
  resume,
51
51
  )
@@ -5,17 +5,16 @@ export default () => (dispatch) => (opts, handler) => {
5
5
 
6
6
  const body = opts.body({ signal: opts.signal })
7
7
 
8
- if (typeof body?.then === 'function') {
9
- body.then(
10
- (body) => {
11
- dispatch({ ...opts, body }, handler)
12
- },
13
- (err) => {
14
- handler.onError(err)
15
- },
16
- )
17
- return true
18
- } else {
8
+ if (typeof body?.then !== 'function') {
19
9
  return dispatch({ ...opts, body }, handler)
20
10
  }
11
+
12
+ body.then(
13
+ (body) => {
14
+ dispatch({ ...opts, body }, handler)
15
+ },
16
+ (err) => {
17
+ handler.onError(err)
18
+ },
19
+ )
21
20
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/nxt-undici",
3
- "version": "6.0.0",
3
+ "version": "6.0.1",
4
4
  "license": "MIT",
5
5
  "author": "Robert Nagy <robert.nagy@boffins.se>",
6
6
  "main": "lib/index.js",