qs 5.2.0 → 6.0.2
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 +17 -0
- package/.travis.yml +66 -5
- package/CHANGELOG.md +86 -75
- package/README.md +85 -81
- package/bower.json +1 -1
- package/component.json +1 -1
- package/dist/qs.js +108 -177
- package/lib/index.js +1 -7
- package/lib/parse.js +26 -49
- package/lib/stringify.js +22 -46
- package/lib/utils.js +45 -73
- package/package.json +28 -11
- package/test/index.js +5 -0
- package/test/parse.js +236 -321
- package/test/stringify.js +139 -197
- package/test/utils.js +6 -25
package/.eslintrc
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"root": true,
|
|
3
|
+
|
|
4
|
+
"extends": "@ljharb",
|
|
5
|
+
|
|
6
|
+
"rules": {
|
|
7
|
+
"complexity": [2, 18],
|
|
8
|
+
"consistent-return": [1],
|
|
9
|
+
"max-params": [2, 8],
|
|
10
|
+
"max-statements": [2, 32],
|
|
11
|
+
"no-extra-parens": [1],
|
|
12
|
+
"no-continue": [1],
|
|
13
|
+
"no-magic-numbers": 0,
|
|
14
|
+
"no-restricted-syntax": [2, "BreakStatement", "DebuggerStatement", "ForInStatement", "LabeledStatement", "WithStatement"],
|
|
15
|
+
"operator-linebreak": 1
|
|
16
|
+
}
|
|
17
|
+
}
|
package/.travis.yml
CHANGED
|
@@ -1,8 +1,69 @@
|
|
|
1
1
|
language: node_js
|
|
2
|
-
|
|
3
2
|
node_js:
|
|
4
|
-
-
|
|
5
|
-
-
|
|
6
|
-
-
|
|
7
|
-
|
|
3
|
+
- "5.3"
|
|
4
|
+
- "5.2"
|
|
5
|
+
- "5.1"
|
|
6
|
+
- "5.0"
|
|
7
|
+
- "4.2"
|
|
8
|
+
- "4.1"
|
|
9
|
+
- "4.0"
|
|
10
|
+
- "iojs-v3.3"
|
|
11
|
+
- "iojs-v3.2"
|
|
12
|
+
- "iojs-v3.1"
|
|
13
|
+
- "iojs-v3.0"
|
|
14
|
+
- "iojs-v2.5"
|
|
15
|
+
- "iojs-v2.4"
|
|
16
|
+
- "iojs-v2.3"
|
|
17
|
+
- "iojs-v2.2"
|
|
18
|
+
- "iojs-v2.1"
|
|
19
|
+
- "iojs-v2.0"
|
|
20
|
+
- "iojs-v1.8"
|
|
21
|
+
- "iojs-v1.7"
|
|
22
|
+
- "iojs-v1.6"
|
|
23
|
+
- "iojs-v1.5"
|
|
24
|
+
- "iojs-v1.4"
|
|
25
|
+
- "iojs-v1.3"
|
|
26
|
+
- "iojs-v1.2"
|
|
27
|
+
- "iojs-v1.1"
|
|
28
|
+
- "iojs-v1.0"
|
|
29
|
+
- "0.12"
|
|
30
|
+
- "0.11"
|
|
31
|
+
- "0.10"
|
|
32
|
+
- "0.9"
|
|
33
|
+
- "0.8"
|
|
34
|
+
- "0.6"
|
|
35
|
+
- "0.4"
|
|
36
|
+
before_install:
|
|
37
|
+
- 'if [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then case "$(npm --version)" in 1.*) npm install -g npm@1.4.28 ;; 2.*) npm install -g npm@2 ;; esac ; fi'
|
|
38
|
+
- 'if [ "${TRAVIS_NODE_VERSION}" != "0.6" ] && [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then npm install -g npm; fi'
|
|
39
|
+
script:
|
|
40
|
+
- 'if [ "${TRAVIS_NODE_VERSION}" != "4.2" ]; then npm run tests-only ; else npm test ; fi'
|
|
8
41
|
sudo: false
|
|
42
|
+
matrix:
|
|
43
|
+
fast_finish: true
|
|
44
|
+
allow_failures:
|
|
45
|
+
- node_js: "5.2"
|
|
46
|
+
- node_js: "5.1"
|
|
47
|
+
- node_js: "5.0"
|
|
48
|
+
- node_js: "4.1"
|
|
49
|
+
- node_js: "4.0"
|
|
50
|
+
- node_js: "iojs-v3.2"
|
|
51
|
+
- node_js: "iojs-v3.1"
|
|
52
|
+
- node_js: "iojs-v3.0"
|
|
53
|
+
- node_js: "iojs-v2.4"
|
|
54
|
+
- node_js: "iojs-v2.3"
|
|
55
|
+
- node_js: "iojs-v2.2"
|
|
56
|
+
- node_js: "iojs-v2.1"
|
|
57
|
+
- node_js: "iojs-v2.0"
|
|
58
|
+
- node_js: "iojs-v1.7"
|
|
59
|
+
- node_js: "iojs-v1.6"
|
|
60
|
+
- node_js: "iojs-v1.5"
|
|
61
|
+
- node_js: "iojs-v1.4"
|
|
62
|
+
- node_js: "iojs-v1.3"
|
|
63
|
+
- node_js: "iojs-v1.2"
|
|
64
|
+
- node_js: "iojs-v1.1"
|
|
65
|
+
- node_js: "iojs-v1.0"
|
|
66
|
+
- node_js: "0.11"
|
|
67
|
+
- node_js: "0.9"
|
|
68
|
+
- node_js: "0.6"
|
|
69
|
+
- node_js: "0.4"
|
package/CHANGELOG.md
CHANGED
|
@@ -1,99 +1,110 @@
|
|
|
1
|
+
## [**6.0.2**](https://github.com/ljharb/qs/issues?milestone=33&state=closed)
|
|
2
|
+
- Revert ES6 requirement and restore support for node down to v0.8.
|
|
1
3
|
|
|
2
|
-
## [**
|
|
3
|
-
- [**#
|
|
4
|
-
- [**#106**](https://github.com/hapijs/qs/issues/106) Add flag `skipNulls` to optionally skip null values in stringify
|
|
4
|
+
## [**6.0.1**](https://github.com/ljharb/qs/issues?milestone=32&state=closed)
|
|
5
|
+
- [**#127**](https://github.com/ljharb/qs/pull/127) Fix engines definition in package.json
|
|
5
6
|
|
|
6
|
-
## [**
|
|
7
|
-
- [**#
|
|
8
|
-
- [**#100**](https://github.com/hapijs/qs/issues/100) include dist to npm
|
|
7
|
+
## [**6.0.0**](https://github.com/ljharb/qs/issues?milestone=31&state=closed)
|
|
8
|
+
- [**#124**](https://github.com/ljharb/qs/issues/124) Use ES6 and drop support for node < v4
|
|
9
9
|
|
|
10
|
-
## [**
|
|
11
|
-
- [**#
|
|
10
|
+
## [**5.2.0**](https://github.com/ljharb/qs/issues?milestone=30&state=closed)
|
|
11
|
+
- [**#64**](https://github.com/ljharb/qs/issues/64) Add option to sort object keys in the query string
|
|
12
12
|
|
|
13
|
-
## [**
|
|
14
|
-
- [**#
|
|
13
|
+
## [**5.1.0**](https://github.com/ljharb/qs/issues?milestone=29&state=closed)
|
|
14
|
+
- [**#117**](https://github.com/ljharb/qs/issues/117) make URI encoding stringified results optional
|
|
15
|
+
- [**#106**](https://github.com/ljharb/qs/issues/106) Add flag `skipNulls` to optionally skip null values in stringify
|
|
15
16
|
|
|
16
|
-
## [**
|
|
17
|
-
- [**#
|
|
18
|
-
- [**#
|
|
19
|
-
- [**#60**](https://github.com/hapijs/qs/issues/60) Add explicit option to disable array parsing
|
|
20
|
-
- [**#74**](https://github.com/hapijs/qs/issues/74) Bad parse when turning array into object
|
|
21
|
-
- [**#81**](https://github.com/hapijs/qs/issues/81) Add a `filter` option
|
|
22
|
-
- [**#68**](https://github.com/hapijs/qs/issues/68) Fixed issue with recursion and passing strings into objects.
|
|
23
|
-
- [**#66**](https://github.com/hapijs/qs/issues/66) Add mixed array and object dot notation support Closes: #47
|
|
24
|
-
- [**#76**](https://github.com/hapijs/qs/issues/76) RFC 3986
|
|
25
|
-
- [**#85**](https://github.com/hapijs/qs/issues/85) No equal sign
|
|
26
|
-
- [**#84**](https://github.com/hapijs/qs/issues/84) update license attribute
|
|
17
|
+
## [**5.0.0**](https://github.com/ljharb/qs/issues?milestone=28&state=closed)
|
|
18
|
+
- [**#114**](https://github.com/ljharb/qs/issues/114) default allowDots to false
|
|
19
|
+
- [**#100**](https://github.com/ljharb/qs/issues/100) include dist to npm
|
|
27
20
|
|
|
28
|
-
## [**
|
|
29
|
-
- [**#
|
|
21
|
+
## [**4.0.0**](https://github.com/ljharb/qs/issues?milestone=26&state=closed)
|
|
22
|
+
- [**#98**](https://github.com/ljharb/qs/issues/98) make returning plain objects and allowing prototype overwriting properties optional
|
|
30
23
|
|
|
31
|
-
## [**
|
|
32
|
-
- [**#
|
|
24
|
+
## [**3.1.0**](https://github.com/ljharb/qs/issues?milestone=24&state=closed)
|
|
25
|
+
- [**#89**](https://github.com/ljharb/qs/issues/89) Add option to disable "Transform dot notation to bracket notation"
|
|
33
26
|
|
|
34
|
-
## [**
|
|
35
|
-
- [**#
|
|
36
|
-
- [**#
|
|
27
|
+
## [**3.0.0**](https://github.com/ljharb/qs/issues?milestone=23&state=closed)
|
|
28
|
+
- [**#80**](https://github.com/ljharb/qs/issues/80) qs.parse silently drops properties
|
|
29
|
+
- [**#77**](https://github.com/ljharb/qs/issues/77) Perf boost
|
|
30
|
+
- [**#60**](https://github.com/ljharb/qs/issues/60) Add explicit option to disable array parsing
|
|
31
|
+
- [**#74**](https://github.com/ljharb/qs/issues/74) Bad parse when turning array into object
|
|
32
|
+
- [**#81**](https://github.com/ljharb/qs/issues/81) Add a `filter` option
|
|
33
|
+
- [**#68**](https://github.com/ljharb/qs/issues/68) Fixed issue with recursion and passing strings into objects.
|
|
34
|
+
- [**#66**](https://github.com/ljharb/qs/issues/66) Add mixed array and object dot notation support Closes: #47
|
|
35
|
+
- [**#76**](https://github.com/ljharb/qs/issues/76) RFC 3986
|
|
36
|
+
- [**#85**](https://github.com/ljharb/qs/issues/85) No equal sign
|
|
37
|
+
- [**#84**](https://github.com/ljharb/qs/issues/84) update license attribute
|
|
37
38
|
|
|
38
|
-
## [**2.
|
|
39
|
-
- [**#
|
|
39
|
+
## [**2.4.1**](https://github.com/ljharb/qs/issues?milestone=20&state=closed)
|
|
40
|
+
- [**#73**](https://github.com/ljharb/qs/issues/73) Property 'hasOwnProperty' of object #<Object> is not a function
|
|
40
41
|
|
|
41
|
-
## [**2.
|
|
42
|
-
- [**#
|
|
42
|
+
## [**2.4.0**](https://github.com/ljharb/qs/issues?milestone=19&state=closed)
|
|
43
|
+
- [**#70**](https://github.com/ljharb/qs/issues/70) Add arrayFormat option
|
|
43
44
|
|
|
44
|
-
## [**2.3.
|
|
45
|
-
- [**#
|
|
45
|
+
## [**2.3.3**](https://github.com/ljharb/qs/issues?milestone=18&state=closed)
|
|
46
|
+
- [**#59**](https://github.com/ljharb/qs/issues/59) make sure array indexes are >= 0, closes #57
|
|
47
|
+
- [**#58**](https://github.com/ljharb/qs/issues/58) make qs usable for browser loader
|
|
46
48
|
|
|
47
|
-
## [**2.2
|
|
48
|
-
- [**#
|
|
49
|
-
- [**#49**](https://github.com/hapijs/qs/issues/49) refactor utils.merge, fixes #45
|
|
50
|
-
- [**#41**](https://github.com/hapijs/qs/issues/41) avoid browserifying Buffer, for #39
|
|
49
|
+
## [**2.3.2**](https://github.com/ljharb/qs/issues?milestone=17&state=closed)
|
|
50
|
+
- [**#55**](https://github.com/ljharb/qs/issues/55) allow merging a string into an object
|
|
51
51
|
|
|
52
|
-
## [**2.
|
|
53
|
-
- [**#
|
|
52
|
+
## [**2.3.1**](https://github.com/ljharb/qs/issues?milestone=16&state=closed)
|
|
53
|
+
- [**#52**](https://github.com/ljharb/qs/issues/52) Return "undefined" and "false" instead of throwing "TypeError".
|
|
54
54
|
|
|
55
|
-
## [**2.
|
|
56
|
-
- [**#
|
|
57
|
-
- [**#36**](https://github.com/hapijs/qs/issues/36) Update to lab 4.x
|
|
55
|
+
## [**2.3.0**](https://github.com/ljharb/qs/issues?milestone=15&state=closed)
|
|
56
|
+
- [**#50**](https://github.com/ljharb/qs/issues/50) add option to omit array indices, closes #46
|
|
58
57
|
|
|
59
|
-
## [**2.2.
|
|
60
|
-
- [**#
|
|
61
|
-
- [**#
|
|
62
|
-
- [**#
|
|
58
|
+
## [**2.2.5**](https://github.com/ljharb/qs/issues?milestone=14&state=closed)
|
|
59
|
+
- [**#39**](https://github.com/ljharb/qs/issues/39) Is there an alternative to Buffer.isBuffer?
|
|
60
|
+
- [**#49**](https://github.com/ljharb/qs/issues/49) refactor utils.merge, fixes #45
|
|
61
|
+
- [**#41**](https://github.com/ljharb/qs/issues/41) avoid browserifying Buffer, for #39
|
|
63
62
|
|
|
64
|
-
## [**2.2.
|
|
65
|
-
- [**#
|
|
66
|
-
- [**#31**](https://github.com/hapijs/qs/issues/31) qs.parse stackoverflow on circular objects
|
|
63
|
+
## [**2.2.4**](https://github.com/ljharb/qs/issues?milestone=13&state=closed)
|
|
64
|
+
- [**#38**](https://github.com/ljharb/qs/issues/38) how to handle object keys beginning with a number
|
|
67
65
|
|
|
68
|
-
## [**2.2.
|
|
69
|
-
- [**#
|
|
70
|
-
- [**#
|
|
71
|
-
- [**#29**](https://github.com/hapijs/qs/issues/29) Don't call Utils.clone at the top of Utils.merge
|
|
72
|
-
- [**#23**](https://github.com/hapijs/qs/issues/23) Ability to not limit parameters?
|
|
66
|
+
## [**2.2.3**](https://github.com/ljharb/qs/issues?milestone=12&state=closed)
|
|
67
|
+
- [**#37**](https://github.com/ljharb/qs/issues/37) parser discards first empty value in array
|
|
68
|
+
- [**#36**](https://github.com/ljharb/qs/issues/36) Update to lab 4.x
|
|
73
69
|
|
|
74
|
-
## [**2.
|
|
75
|
-
- [**#
|
|
70
|
+
## [**2.2.2**](https://github.com/ljharb/qs/issues?milestone=11&state=closed)
|
|
71
|
+
- [**#33**](https://github.com/ljharb/qs/issues/33) Error when plain object in a value
|
|
72
|
+
- [**#34**](https://github.com/ljharb/qs/issues/34) use Object.prototype.hasOwnProperty.call instead of obj.hasOwnProperty
|
|
73
|
+
- [**#24**](https://github.com/ljharb/qs/issues/24) Changelog? Semver?
|
|
76
74
|
|
|
77
|
-
## [**2.
|
|
78
|
-
- [**#
|
|
79
|
-
- [**#
|
|
80
|
-
- [**#21**](https://github.com/hapijs/qs/issues/21) make all limits optional, for #18, for #20
|
|
75
|
+
## [**2.2.1**](https://github.com/ljharb/qs/issues?milestone=10&state=closed)
|
|
76
|
+
- [**#32**](https://github.com/ljharb/qs/issues/32) account for circular references properly, closes #31
|
|
77
|
+
- [**#31**](https://github.com/ljharb/qs/issues/31) qs.parse stackoverflow on circular objects
|
|
81
78
|
|
|
82
|
-
## [**
|
|
83
|
-
- [**#
|
|
79
|
+
## [**2.2.0**](https://github.com/ljharb/qs/issues?milestone=9&state=closed)
|
|
80
|
+
- [**#26**](https://github.com/ljharb/qs/issues/26) Don't use Buffer global if it's not present
|
|
81
|
+
- [**#30**](https://github.com/ljharb/qs/issues/30) Bug when merging non-object values into arrays
|
|
82
|
+
- [**#29**](https://github.com/ljharb/qs/issues/29) Don't call Utils.clone at the top of Utils.merge
|
|
83
|
+
- [**#23**](https://github.com/ljharb/qs/issues/23) Ability to not limit parameters?
|
|
84
84
|
|
|
85
|
-
## [**
|
|
86
|
-
- [**#
|
|
87
|
-
- [**#15**](https://github.com/hapijs/qs/issues/15) Close code block
|
|
85
|
+
## [**2.1.0**](https://github.com/ljharb/qs/issues?milestone=8&state=closed)
|
|
86
|
+
- [**#22**](https://github.com/ljharb/qs/issues/22) Enable using a RegExp as delimiter
|
|
88
87
|
|
|
89
|
-
## [**
|
|
90
|
-
- [**#
|
|
91
|
-
- [**#
|
|
88
|
+
## [**2.0.0**](https://github.com/ljharb/qs/issues?milestone=7&state=closed)
|
|
89
|
+
- [**#18**](https://github.com/ljharb/qs/issues/18) Why is there arrayLimit?
|
|
90
|
+
- [**#20**](https://github.com/ljharb/qs/issues/20) Configurable parametersLimit
|
|
91
|
+
- [**#21**](https://github.com/ljharb/qs/issues/21) make all limits optional, for #18, for #20
|
|
92
92
|
|
|
93
|
-
## [**1.
|
|
94
|
-
- [**#
|
|
95
|
-
- [**#9**](https://github.com/hapijs/qs/issues/9) Should not omit equals signs (=) when value is null
|
|
96
|
-
- [**#6**](https://github.com/hapijs/qs/issues/6) Minor grammar fix in README
|
|
93
|
+
## [**1.2.2**](https://github.com/ljharb/qs/issues?milestone=6&state=closed)
|
|
94
|
+
- [**#19**](https://github.com/ljharb/qs/issues/19) Don't overwrite null values
|
|
97
95
|
|
|
98
|
-
## [**1.
|
|
99
|
-
- [**#
|
|
96
|
+
## [**1.2.1**](https://github.com/ljharb/qs/issues?milestone=5&state=closed)
|
|
97
|
+
- [**#16**](https://github.com/ljharb/qs/issues/16) ignore non-string delimiters
|
|
98
|
+
- [**#15**](https://github.com/ljharb/qs/issues/15) Close code block
|
|
99
|
+
|
|
100
|
+
## [**1.2.0**](https://github.com/ljharb/qs/issues?milestone=4&state=closed)
|
|
101
|
+
- [**#12**](https://github.com/ljharb/qs/issues/12) Add optional delim argument
|
|
102
|
+
- [**#13**](https://github.com/ljharb/qs/issues/13) fix #11: flattened keys in array are now correctly parsed
|
|
103
|
+
|
|
104
|
+
## [**1.1.0**](https://github.com/ljharb/qs/issues?milestone=3&state=closed)
|
|
105
|
+
- [**#7**](https://github.com/ljharb/qs/issues/7) Empty values of a POST array disappear after being submitted
|
|
106
|
+
- [**#9**](https://github.com/ljharb/qs/issues/9) Should not omit equals signs (=) when value is null
|
|
107
|
+
- [**#6**](https://github.com/ljharb/qs/issues/6) Minor grammar fix in README
|
|
108
|
+
|
|
109
|
+
## [**1.0.2**](https://github.com/ljharb/qs/issues?milestone=2&state=closed)
|
|
110
|
+
- [**#5**](https://github.com/ljharb/qs/issues/5) array holes incorrectly copied into object on large index
|