qs 6.11.2 → 6.11.4
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 +11 -0
- package/README.md +9 -3
- package/dist/qs.js +684 -190
- package/lib/parse.js +4 -4
- package/lib/utils.js +7 -7
- package/package.json +1 -1
- package/test/parse.js +9 -0
- package/test/stringify.js +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
## **6.11.4**
|
|
2
|
+
- [Fix] fix regressions from robustness refactor
|
|
3
|
+
- [actions] update reusable workflows
|
|
4
|
+
|
|
5
|
+
## **6.11.3**
|
|
6
|
+
- [Robustness] avoid `.push`, use `void`
|
|
7
|
+
- [readme] clarify `parseArrays` and `arrayLimit` documentation (#543)
|
|
8
|
+
- [readme] document that `addQueryPrefix` does not add `?` to empty output (#418)
|
|
9
|
+
- [readme] replace runkit CI badge with shields.io check-runs badge
|
|
10
|
+
- [actions] fix rebase workflow permissions
|
|
11
|
+
|
|
1
12
|
## **6.11.2**
|
|
2
13
|
- [Fix] `parse`: Fix parsing when the global Object prototype is frozen (#473)
|
|
3
14
|
- [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
|
|
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
|
|
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/
|
|
668
|
+
[actions-image]: https://img.shields.io/github/check-runs/ljharb/qs/main
|
|
663
669
|
[actions-url]: https://github.com/ljharb/qs/actions
|