qs.stringify crashes on null/undefined entries in comma-format arrays under encodeValuesOnly
ljharb qs
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| qs npm |
|
|
Original description
### Summary
`qs.stringify` throws `TypeError` when called with `arrayFormat: 'comma'` and `encodeValuesOnly: true` on an array containing `null` or `undefined`. The throw is synchronous and not handled by any of qs's null-related options (`skipNulls`, `strictNullHandling`).
### Details
In the comma + `encodeValuesOnly` branch, `lib/stringify.js:145` mapped the array through the raw encoder before joining:
```js
obj = utils.maybeMap(obj, encoder);
```