@nxtedition/nxt-undici 2.0.57 → 2.0.58

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.
Files changed (2) hide show
  1. package/lib/utils.js +8 -4
  2. package/package.json +1 -1
package/lib/utils.js CHANGED
@@ -235,12 +235,14 @@ export function parseHeaders(headers, obj) {
235
235
  }
236
236
 
237
237
  if (Array.isArray(val2)) {
238
- val.push(...val2.map((x) => `${x}`))
238
+ val.push(...val2.filter((x) => x != null).map((x) => `${x}`))
239
239
  } else {
240
240
  val.push(`${val2}`)
241
241
  }
242
242
  } else {
243
- obj[key] = Array.isArray(val2) ? val2.map((x) => `${x}`) : `${val2}`
243
+ obj[key] = Array.isArray(val2)
244
+ ? val2.filter((x) => x != null).map((x) => `${x}`)
245
+ : `${val2}`
244
246
  }
245
247
  }
246
248
  } else if (typeof headers === 'object' && headers !== null) {
@@ -263,12 +265,14 @@ export function parseHeaders(headers, obj) {
263
265
  obj[key] = val
264
266
  }
265
267
  if (Array.isArray(val2)) {
266
- val.push(...val2.map((x) => `${x}`))
268
+ val.push(...val2.filter((x) => x != null).map((x) => `${x}`))
267
269
  } else {
268
270
  val.push(`${val2}`)
269
271
  }
270
272
  } else if (val2 != null) {
271
- obj[key] = Array.isArray(val2) ? val2.map((x) => `${x}`) : `${val2}`
273
+ obj[key] = Array.isArray(val2)
274
+ ? val2.filter((x) => x != null).map((x) => `${x}`)
275
+ : `${val2}`
272
276
  }
273
277
  }
274
278
  } else if (headers != null) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/nxt-undici",
3
- "version": "2.0.57",
3
+ "version": "2.0.58",
4
4
  "license": "MIT",
5
5
  "author": "Robert Nagy <robert.nagy@boffins.se>",
6
6
  "main": "lib/index.js",