qs 6.1.3 → 6.1.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/.nyc_output/1822e37208f8ddf8a5a1fbca19530afd.json +1 -0
- package/.nyc_output/df674434f0523b341fb8957fc9158867.json +1 -0
- package/CHANGELOG.md +5 -0
- package/coverage/coverage-final.json +9 -9
- package/coverage/index.html +26 -26
- package/coverage/lib/formats.js.html +1 -1
- package/coverage/lib/index.html +25 -25
- package/coverage/lib/index.js.html +1 -1
- package/coverage/lib/parse.js.html +144 -366
- package/coverage/lib/stringify.js.html +49 -49
- package/coverage/lib/utils.js.html +112 -328
- package/coverage/test/empty-keys-cases.js.html +1 -1
- package/coverage/test/index.html +23 -23
- package/coverage/test/parse.js.html +50 -998
- package/coverage/test/stringify.js.html +21 -15
- package/coverage/test/utils.js.html +6 -747
- package/dist/qs.js +1 -1
- package/lib/parse.js +1 -1
- package/package.json +14 -4
- package/test/parse.js +9 -0
- package/.nyc_output/029de7ebb4082eaaba62a345c454be63.json +0 -1
- package/.nyc_output/e616cdc4199f5d1583ad7e3c74346432.json +0 -1
- package/.travis.yml +0 -173
- package/bower.json +0 -21
- package/component.json +0 -15
package/dist/qs.js
CHANGED
|
@@ -137,7 +137,7 @@ internals.parseKeys = function (givenKey, val, options) {
|
|
|
137
137
|
// If there's a remainder, just add whatever is left
|
|
138
138
|
|
|
139
139
|
if (segment) {
|
|
140
|
-
keys[keys.length] = '[' + key.slice(segment.index + ']'
|
|
140
|
+
keys[keys.length] = '[' + key.slice(segment.index) + ']';
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
return internals.parseObject(keys, val, options);
|
package/lib/parse.js
CHANGED
|
@@ -125,7 +125,7 @@ internals.parseKeys = function (givenKey, val, options) {
|
|
|
125
125
|
// If there's a remainder, just add whatever is left
|
|
126
126
|
|
|
127
127
|
if (segment) {
|
|
128
|
-
keys[keys.length] = '[' + key.slice(segment.index + ']'
|
|
128
|
+
keys[keys.length] = '[' + key.slice(segment.index) + ']';
|
|
129
129
|
}
|
|
130
130
|
|
|
131
131
|
return internals.parseObject(keys, val, options);
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "qs",
|
|
3
3
|
"description": "A querystring parser that supports nesting and arrays, with a depth limit",
|
|
4
4
|
"homepage": "https://github.com/ljharb/qs",
|
|
5
|
-
"version": "6.1.
|
|
5
|
+
"version": "6.1.4",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "https://github.com/ljharb/qs.git"
|
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
"eslint": "^1.10.3",
|
|
32
32
|
"@ljharb/eslint-config": "^1.6.1",
|
|
33
33
|
"parallelshell": "^2.0.0",
|
|
34
|
-
"evalmd": "^0.0.16"
|
|
34
|
+
"evalmd": "^0.0.16",
|
|
35
|
+
"npmignore": "^0.3.1"
|
|
35
36
|
},
|
|
36
37
|
"scripts": {
|
|
37
38
|
"pretest": "npm run lint && npm run readme",
|
|
@@ -41,7 +42,16 @@
|
|
|
41
42
|
"lint": "eslint lib/*.js text/*.js",
|
|
42
43
|
"coverage": "covert test",
|
|
43
44
|
"dist": "mkdirp dist && browserify --standalone Qs lib/index.js > dist/qs.js",
|
|
44
|
-
"prepublish": "npm run dist"
|
|
45
|
+
"prepublish": "npmignore --auto --commentLines=autogenerated && npm run dist"
|
|
45
46
|
},
|
|
46
|
-
"license": "BSD-3-Clause"
|
|
47
|
+
"license": "BSD-3-Clause",
|
|
48
|
+
"publishConfig": {
|
|
49
|
+
"ignore": [
|
|
50
|
+
"!dist/*",
|
|
51
|
+
"bower.json",
|
|
52
|
+
"component.json",
|
|
53
|
+
".github/workflows",
|
|
54
|
+
".travis.yml"
|
|
55
|
+
]
|
|
56
|
+
}
|
|
47
57
|
}
|
package/test/parse.js
CHANGED
|
@@ -49,6 +49,15 @@ test('parse()', function (t) {
|
|
|
49
49
|
st.end();
|
|
50
50
|
});
|
|
51
51
|
|
|
52
|
+
t.test('correctly computes the remainder when depth is exceeded', function (st) {
|
|
53
|
+
st.deepEqual(
|
|
54
|
+
qs.parse('a[b][c][d][e]=f', { depth: 2 }),
|
|
55
|
+
{ a: { b: { c: { '[d][e]': 'f' } } } },
|
|
56
|
+
'the remainder is "[d][e]", not the full original key'
|
|
57
|
+
);
|
|
58
|
+
st.end();
|
|
59
|
+
});
|
|
60
|
+
|
|
52
61
|
t.deepEqual(qs.parse('a=b&a=c'), { a: ['b', 'c'] }, 'parses a simple array');
|
|
53
62
|
|
|
54
63
|
t.test('parses an explicit array', function (st) {
|