qs 6.2.5 → 6.2.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/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## **6.2.6**
2
+ - [Fix] fix regression from robustness refactor
3
+ - [meta] add `npmignore` to autogenerate an npmignore file
4
+ - [actions] update reusable workflows
5
+
1
6
  ## **6.2.5**
2
7
  - [Robustness] avoid `.push`, use `void`
3
8
  - [readme] clarify `parseArrays` and `arrayLimit` documentation (#543)
package/dist/qs.js CHANGED
@@ -136,7 +136,7 @@ var parseKeys = function parseKeys(givenKey, val, options) {
136
136
  // If there's a remainder, just add whatever is left
137
137
 
138
138
  if (segment) {
139
- keys[keys.length] = '[' + key.slice(segment.index + ']');
139
+ keys[keys.length] = '[' + key.slice(segment.index) + ']';
140
140
  }
141
141
 
142
142
  return parseObject(keys, val, options);
package/lib/parse.js CHANGED
@@ -124,7 +124,7 @@ var parseKeys = function parseKeys(givenKey, val, options) {
124
124
  // If there's a remainder, just add whatever is left
125
125
 
126
126
  if (segment) {
127
- keys[keys.length] = '[' + key.slice(segment.index + ']');
127
+ keys[keys.length] = '[' + key.slice(segment.index) + ']';
128
128
  }
129
129
 
130
130
  return 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.2.5",
5
+ "version": "6.2.6",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/ljharb/qs.git"
@@ -36,10 +36,11 @@
36
36
  "qs-iconv": "^1.0.4",
37
37
  "safe-publish-latest": "^2.0.0",
38
38
  "safer-buffer": "^2.1.2",
39
- "tape": "^5.4.0"
39
+ "tape": "^5.4.0",
40
+ "npmignore": "^0.3.1"
40
41
  },
41
42
  "scripts": {
42
- "prepublishOnly": "safe-publish-latest && npm run dist",
43
+ "prepublishOnly": "safe-publish-latest && npmignore --auto --commentLines=autogenerated && npm run dist",
43
44
  "prepublish": "not-in-publish || npm run prepublishOnly",
44
45
  "pretest": "npm run --silent readme && npm run --silent lint",
45
46
  "test": "npm run --silent tests-only",
@@ -50,5 +51,13 @@
50
51
  "lint": "eslint --ext=js,mjs .",
51
52
  "dist": "mkdirp dist && browserify --standalone Qs lib/index.js > dist/qs.js"
52
53
  },
53
- "license": "BSD-3-Clause"
54
+ "license": "BSD-3-Clause",
55
+ "publishConfig": {
56
+ "ignore": [
57
+ "!dist/*",
58
+ "bower.json",
59
+ "component.json",
60
+ ".github/workflows"
61
+ ]
62
+ }
54
63
  }
package/test/parse.js CHANGED
@@ -51,6 +51,15 @@ test('parse()', function (t) {
51
51
  st.end();
52
52
  });
53
53
 
54
+ t.test('correctly computes the remainder when depth is exceeded', function (st) {
55
+ st.deepEqual(
56
+ qs.parse('a[b][c][d][e]=f', { depth: 2 }),
57
+ { a: { b: { c: { '[d][e]': 'f' } } } },
58
+ 'the remainder is "[d][e]", not the full original key'
59
+ );
60
+ st.end();
61
+ });
62
+
54
63
  t.deepEqual(qs.parse('a=b&a=c'), { a: ['b', 'c'] }, 'parses a simple array');
55
64
 
56
65
  t.test('parses an explicit array', function (st) {
package/bower.json DELETED
@@ -1,21 +0,0 @@
1
- {
2
- "name": "qs",
3
- "main": "dist/qs.js",
4
- "homepage": "https://github.com/hapijs/qs",
5
- "authors": [
6
- "Nathan LaFreniere <quitlahok@gmail.com>"
7
- ],
8
- "description": "A querystring parser that supports nesting and arrays, with a depth limit",
9
- "keywords": [
10
- "querystring",
11
- "qs"
12
- ],
13
- "license": "BSD-3-Clause",
14
- "ignore": [
15
- "**/.*",
16
- "node_modules",
17
- "bower_components",
18
- "test",
19
- "tests"
20
- ]
21
- }
package/component.json DELETED
@@ -1,15 +0,0 @@
1
- {
2
- "name": "qs",
3
- "repository": "hapijs/qs",
4
- "description": "query-string parser / stringifier with nesting support",
5
- "version": "6.2.4",
6
- "keywords": ["querystring", "query", "parser"],
7
- "main": "lib/index.js",
8
- "scripts": [
9
- "lib/index.js",
10
- "lib/parse.js",
11
- "lib/stringify.js",
12
- "lib/utils.js"
13
- ],
14
- "license": "BSD-3-Clause"
15
- }