qs 6.11.2 → 6.11.3

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## **6.11.3**
2
+ - [Robustness] avoid `.push`, use `void`
3
+ - [readme] clarify `parseArrays` and `arrayLimit` documentation (#543)
4
+ - [readme] document that `addQueryPrefix` does not add `?` to empty output (#418)
5
+ - [readme] replace runkit CI badge with shields.io check-runs badge
6
+ - [actions] fix rebase workflow permissions
7
+
1
8
  ## **6.11.2**
2
9
  - [Fix] `parse`: Fix parsing when the global Object prototype is frozen (#473)
3
10
  - [Tests] add passing test cases with empty keys (#473)
package/README.md CHANGED
@@ -245,7 +245,7 @@ var withIndexedEmptyString = qs.parse('a[0]=b&a[1]=&a[2]=c');
245
245
  assert.deepEqual(withIndexedEmptyString, { a: ['b', '', 'c'] });
246
246
  ```
247
247
 
248
- **qs** will also limit specifying indices in an array to a maximum index of `20`. Any array members with an index of greater than `20` will
248
+ **qs** will also limit arrays to a maximum of `20` elements. Any array members with an index of `20` or greater will
249
249
  instead be converted to an object with the index as the key. This is needed to handle cases when someone sent, for example, `a[999999999]` and it will take significant time to iterate over this huge array.
250
250
 
251
251
  ```javascript
@@ -260,7 +260,7 @@ var withArrayLimit = qs.parse('a[1]=b', { arrayLimit: 0 });
260
260
  assert.deepEqual(withArrayLimit, { a: { '1': 'b' } });
261
261
  ```
262
262
 
263
- To disable array parsing entirely, set `parseArrays` to `false`.
263
+ To prevent array syntax (`a[]`, `a[0]`) from being parsed as arrays, set `parseArrays` to `false`.
264
264
 
265
265
  ```javascript
266
266
  var noParsingArrays = qs.parse('a[]=b', { parseArrays: false });
@@ -446,6 +446,12 @@ The query string may optionally be prepended with a question mark:
446
446
  assert.equal(qs.stringify({ a: 'b', c: 'd' }, { addQueryPrefix: true }), '?a=b&c=d');
447
447
  ```
448
448
 
449
+ Note that when the output is an empty string, the prefix will not be added:
450
+
451
+ ```javascript
452
+ assert.equal(qs.stringify({}, { addQueryPrefix: true }), '');
453
+ ```
454
+
449
455
  The delimiter may be overridden with stringify as well:
450
456
 
451
457
  ```javascript
@@ -659,5 +665,5 @@ The maintainers of qs and thousands of other packages are working with Tidelift
659
665
  [downloads-url]: https://npm-stat.com/charts.html?package=qs
660
666
  [codecov-image]: https://codecov.io/gh/ljharb/qs/branch/main/graphs/badge.svg
661
667
  [codecov-url]: https://app.codecov.io/gh/ljharb/qs/
662
- [actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/qs
668
+ [actions-image]: https://img.shields.io/github/check-runs/ljharb/qs/main
663
669
  [actions-url]: https://github.com/ljharb/qs/actions