qs 6.10.4 → 6.10.6
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/.eslintrc +1 -1
- package/CHANGELOG.md +10 -0
- package/README.md +9 -3
- package/dist/qs.js +726 -192
- package/lib/parse.js +4 -4
- package/lib/stringify.js +5 -3
- package/lib/utils.js +7 -7
- package/package.json +1 -1
- package/test/stringify.js +28 -11
package/.eslintrc
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
## **6.10.6**
|
|
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
|
+
|
|
8
|
+
## **6.10.5**
|
|
9
|
+
- [Fix] `stringify`: with `arrayFormat: comma`, properly include an explicit `[]` on a single-item array (#434)
|
|
10
|
+
|
|
1
11
|
## **6.10.4**
|
|
2
12
|
- [Fix] `stringify`: with `arrayFormat: comma`, include an explicit `[]` on a single-item array (#441)
|
|
3
13
|
- [meta] use `npmignore` to autogenerate an npmignore file
|
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 });
|
|
@@ -444,6 +444,12 @@ The query string may optionally be prepended with a question mark:
|
|
|
444
444
|
assert.equal(qs.stringify({ a: 'b', c: 'd' }, { addQueryPrefix: true }), '?a=b&c=d');
|
|
445
445
|
```
|
|
446
446
|
|
|
447
|
+
Note that when the output is an empty string, the prefix will not be added:
|
|
448
|
+
|
|
449
|
+
```javascript
|
|
450
|
+
assert.equal(qs.stringify({}, { addQueryPrefix: true }), '');
|
|
451
|
+
```
|
|
452
|
+
|
|
447
453
|
The delimiter may be overridden with stringify as well:
|
|
448
454
|
|
|
449
455
|
```javascript
|
|
@@ -619,5 +625,5 @@ The maintainers of qs and thousands of other packages are working with Tidelift
|
|
|
619
625
|
[downloads-url]: https://npm-stat.com/charts.html?package=qs
|
|
620
626
|
[codecov-image]: https://codecov.io/gh/ljharb/qs/branch/main/graphs/badge.svg
|
|
621
627
|
[codecov-url]: https://app.codecov.io/gh/ljharb/qs/
|
|
622
|
-
[actions-image]: https://img.shields.io/
|
|
628
|
+
[actions-image]: https://img.shields.io/github/check-runs/ljharb/qs/main
|
|
623
629
|
[actions-url]: https://github.com/ljharb/qs/actions
|