step-node-agent 3.19.0 → 3.20.0

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.
Files changed (105) hide show
  1. package/node_modules/body-parser/HISTORY.md +6 -0
  2. package/node_modules/body-parser/README.md +1 -1
  3. package/node_modules/body-parser/index.js +8 -9
  4. package/node_modules/body-parser/package.json +8 -8
  5. package/node_modules/capture-stack-trace/license +2 -1
  6. package/node_modules/capture-stack-trace/package.json +28 -27
  7. package/node_modules/capture-stack-trace/readme.md +1 -5
  8. package/node_modules/duplexer3/license +10 -0
  9. package/node_modules/duplexer3/package.json +25 -26
  10. package/node_modules/duplexer3/{README.md → readme.md} +25 -41
  11. package/node_modules/express/History.md +9 -0
  12. package/node_modules/express/Readme.md +2 -2
  13. package/node_modules/express/lib/router/route.js +8 -8
  14. package/node_modules/express/package.json +7 -7
  15. package/node_modules/get-intrinsic/.eslintrc +2 -8
  16. package/node_modules/get-intrinsic/.nycrc +0 -4
  17. package/node_modules/get-intrinsic/CHANGELOG.md +34 -0
  18. package/node_modules/get-intrinsic/README.md +7 -1
  19. package/node_modules/get-intrinsic/index.js +4 -0
  20. package/node_modules/get-intrinsic/package.json +25 -12
  21. package/node_modules/get-intrinsic/test/GetIntrinsic.js +25 -11
  22. package/node_modules/glob/common.js +2 -0
  23. package/node_modules/glob/glob.js +4 -1
  24. package/node_modules/glob/package.json +5 -2
  25. package/node_modules/glob/sync.js +6 -3
  26. package/node_modules/is-callable/.editorconfig +5 -0
  27. package/node_modules/is-callable/.eslintrc +0 -11
  28. package/node_modules/is-callable/CHANGELOG.md +50 -0
  29. package/node_modules/is-callable/README.md +16 -0
  30. package/node_modules/is-callable/index.js +35 -8
  31. package/node_modules/is-callable/package.json +27 -13
  32. package/node_modules/is-callable/test/index.js +86 -12
  33. package/node_modules/is-core-module/CHANGELOG.md +7 -0
  34. package/node_modules/is-core-module/core.json +1 -1
  35. package/node_modules/is-core-module/package.json +1 -1
  36. package/node_modules/is-core-module/test/index.js +1 -1
  37. package/node_modules/minimist/.eslintrc +54 -0
  38. package/node_modules/minimist/.github/FUNDING.yml +12 -0
  39. package/node_modules/minimist/.nycrc +14 -0
  40. package/node_modules/minimist/CHANGELOG.md +212 -0
  41. package/node_modules/minimist/{readme.markdown → README.md} +20 -1
  42. package/node_modules/minimist/package.json +39 -9
  43. package/node_modules/object-inspect/CHANGELOG.md +18 -0
  44. package/node_modules/object-inspect/index.js +7 -6
  45. package/node_modules/object-inspect/package-support.json +20 -0
  46. package/node_modules/object-inspect/package.json +20 -10
  47. package/node_modules/object-inspect/test/err.js +3 -3
  48. package/node_modules/object-inspect/test/has.js +6 -25
  49. package/node_modules/object-inspect/test/inspect.js +37 -0
  50. package/node_modules/object-inspect/test/values.js +3 -3
  51. package/node_modules/psl/.env +0 -0
  52. package/node_modules/psl/README.md +1 -5
  53. package/node_modules/psl/data/rules.json +718 -176
  54. package/node_modules/psl/dist/psl.js +720 -178
  55. package/node_modules/psl/dist/psl.min.js +1 -1
  56. package/node_modules/psl/package.json +16 -17
  57. package/node_modules/qs/.editorconfig +3 -0
  58. package/node_modules/qs/.eslintrc +5 -5
  59. package/node_modules/qs/CHANGELOG.md +158 -0
  60. package/node_modules/qs/README.md +3 -1
  61. package/node_modules/qs/dist/qs.js +19 -9
  62. package/node_modules/qs/lib/stringify.js +12 -3
  63. package/node_modules/qs/package.json +16 -12
  64. package/node_modules/qs/test/parse.js +14 -0
  65. package/node_modules/qs/test/stringify.js +54 -10
  66. package/node_modules/resolve/lib/async.js +1 -1
  67. package/node_modules/resolve/lib/core.json +1 -0
  68. package/node_modules/resolve/lib/sync.js +1 -1
  69. package/node_modules/resolve/package.json +14 -5
  70. package/node_modules/resolve/test/core.js +8 -1
  71. package/node_modules/resolve/test/resolver/false_main/index.js +0 -0
  72. package/node_modules/resolve/test/resolver/false_main/package.json +4 -0
  73. package/node_modules/resolve/test/resolver.js +49 -0
  74. package/node_modules/resolve/test/resolver_sync.js +82 -1
  75. package/node_modules/underscore/amd/_set.js +21 -0
  76. package/node_modules/underscore/amd/_setup.js +1 -1
  77. package/node_modules/underscore/amd/set.js +15 -0
  78. package/node_modules/underscore/cjs/_set.js +21 -0
  79. package/node_modules/underscore/cjs/_setup.js +1 -1
  80. package/node_modules/underscore/cjs/set.js +15 -0
  81. package/node_modules/underscore/modules/_setup.js +1 -1
  82. package/node_modules/underscore/modules/index.js +1 -1
  83. package/node_modules/underscore/modules/package.json +1 -3
  84. package/node_modules/underscore/package.json +14 -11
  85. package/node_modules/underscore/underscore-esm-min.js +2 -2
  86. package/node_modules/underscore/underscore-esm.js +2 -2
  87. package/node_modules/underscore/underscore-min.js +2 -2
  88. package/node_modules/underscore/underscore-node-f.cjs +2 -2
  89. package/node_modules/underscore/underscore-node.cjs +1 -1
  90. package/node_modules/underscore/underscore-node.mjs +1 -1
  91. package/node_modules/underscore/underscore-umd-min.js +2 -2
  92. package/node_modules/underscore/underscore-umd.js +2 -2
  93. package/node_modules/underscore/underscore.js +2 -2
  94. package/package.json +1 -1
  95. package/node_modules/duplexer3/LICENSE.md +0 -26
  96. package/node_modules/get-intrinsic/.eslintignore +0 -1
  97. package/node_modules/is-callable/.eslintignore +0 -1
  98. package/node_modules/is-callable/.istanbul.yml +0 -47
  99. package/node_modules/minimist/.travis.yml +0 -8
  100. package/node_modules/object-inspect/.eslintignore +0 -1
  101. package/node_modules/path-exists/index.js +0 -17
  102. package/node_modules/path-exists/license +0 -21
  103. package/node_modules/path-exists/package.json +0 -40
  104. package/node_modules/path-exists/readme.md +0 -50
  105. package/node_modules/resolve/appveyor.yml +0 -76
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "psl",
3
- "version": "1.8.0",
3
+ "version": "1.9.0",
4
4
  "description": "Domain name parser based on the Public Suffix List",
5
5
  "repository": {
6
6
  "type": "git",
@@ -8,8 +8,9 @@
8
8
  },
9
9
  "main": "index.js",
10
10
  "scripts": {
11
- "pretest": "eslint .",
12
- "test": "mocha test && karma start ./karma.conf.js --single-run",
11
+ "lint": "eslint .",
12
+ "test": "mocha test/*.spec.js",
13
+ "test:browserstack": "node test/browserstack.js",
13
14
  "watch": "mocha test --watch",
14
15
  "prebuild": "./scripts/update-rules.js",
15
16
  "build": "browserify ./index.js --standalone=psl > ./dist/psl.js",
@@ -24,21 +25,19 @@
24
25
  "author": "Lupo Montero <lupomontero@gmail.com> (https://lupomontero.com/)",
25
26
  "license": "MIT",
26
27
  "devDependencies": {
27
- "JSONStream": "^1.3.5",
28
- "browserify": "^16.5.0",
28
+ "browserify": "^17.0.0",
29
+ "browserslist-browserstack": "^3.1.1",
30
+ "browserstack-local": "^1.5.1",
31
+ "chai": "^4.3.6",
29
32
  "commit-and-pr": "^1.0.4",
30
- "eslint": "^6.8.0",
31
- "eslint-config-hapi": "^12.0.0",
32
- "eslint-plugin-hapi": "^4.1.0",
33
- "karma": "^4.4.1",
34
- "karma-browserify": "^7.0.0",
35
- "karma-mocha": "^1.3.0",
36
- "karma-mocha-reporter": "^2.2.5",
37
- "karma-phantomjs-launcher": "^1.0.4",
38
- "mocha": "^7.1.1",
39
- "phantomjs-prebuilt": "^2.1.16",
33
+ "eslint": "^8.19.0",
34
+ "JSONStream": "^1.3.5",
35
+ "mocha": "^7.2.0",
36
+ "porch": "^2.0.0",
40
37
  "request": "^2.88.2",
41
- "uglify-js": "^3.8.0",
42
- "watchify": "^3.11.1"
38
+ "selenium-webdriver": "^4.3.0",
39
+ "serve-handler": "^6.1.3",
40
+ "uglify-js": "^3.16.2",
41
+ "watchify": "^4.0.0"
43
42
  }
44
43
  }
@@ -38,3 +38,6 @@ indent_size = off
38
38
  indent_style = off
39
39
  indent = off
40
40
  max_line_length = off
41
+
42
+ [.nycrc]
43
+ indent_style = tab
@@ -14,8 +14,8 @@
14
14
  "id-length": [2, { "min": 1, "max": 25, "properties": "never" }],
15
15
  "indent": [2, 4],
16
16
  "max-lines-per-function": [2, { "max": 150 }],
17
- "max-params": [2, 15],
18
- "max-statements": [2, 52],
17
+ "max-params": [2, 16],
18
+ "max-statements": [2, 53],
19
19
  "multiline-comment-style": 0,
20
20
  "no-continue": 1,
21
21
  "no-magic-numbers": 0,
@@ -32,7 +32,7 @@
32
32
  "no-buffer-constructor": 0,
33
33
  "no-extend-native": 0,
34
34
  "no-throw-literal": 0,
35
- }
36
- }
37
- ]
35
+ },
36
+ },
37
+ ],
38
38
  }
@@ -1,3 +1,15 @@
1
+ ## **6.11.0
2
+ - [New] [Fix] `stringify`: revert 0e903c0; add `commaRoundTrip` option (#442)
3
+ - [readme] fix version badge
4
+
5
+ ## **6.10.5**
6
+ - [Fix] `stringify`: with `arrayFormat: comma`, properly include an explicit `[]` on a single-item array (#434)
7
+
8
+ ## **6.10.4**
9
+ - [Fix] `stringify`: with `arrayFormat: comma`, include an explicit `[]` on a single-item array (#441)
10
+ - [meta] use `npmignore` to autogenerate an npmignore file
11
+ - [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `has-symbol`, `object-inspect`, `tape`
12
+
1
13
  ## **6.10.3**
2
14
  - [Fix] `parse`: ignore `__proto__` keys (#428)
3
15
  - [Robustness] `stringify`: avoid relying on a global `undefined` (#427)
@@ -27,6 +39,18 @@
27
39
  - [Tests] use `ljharb/actions/node/install` instead of `ljharb/actions/node/run`
28
40
  - [Tests] Revert "[meta] ignore eclint transitive audit warning"
29
41
 
42
+ ## **6.9.7**
43
+ - [Fix] `parse`: ignore `__proto__` keys (#428)
44
+ - [Fix] `stringify`: avoid encoding arrayformat comma when `encodeValuesOnly = true` (#424)
45
+ - [Robustness] `stringify`: avoid relying on a global `undefined` (#427)
46
+ - [readme] remove travis badge; add github actions/codecov badges; update URLs
47
+ - [Docs] add note and links for coercing primitive values (#408)
48
+ - [Tests] clean up stringify tests slightly
49
+ - [meta] fix README.md (#399)
50
+ - Revert "[meta] ignore eclint transitive audit warning"
51
+ - [actions] backport actions from main
52
+ - [Dev Deps] backport updates from main
53
+
30
54
  ## **6.9.6**
31
55
  - [Fix] restore `dist` dir; mistakenly removed in d4f6c32
32
56
 
@@ -75,6 +99,19 @@
75
99
  - [Tests] up to `node` `v12.10`, `v11.15`, `v10.16`, `v8.16`
76
100
  - [Tests] `Buffer.from` in node v5.0-v5.9 and v4.0-v4.4 requires a TypedArray
77
101
 
102
+ ## **6.8.3**
103
+ - [Fix] `parse`: ignore `__proto__` keys (#428)
104
+ - [Robustness] `stringify`: avoid relying on a global `undefined` (#427)
105
+ - [Fix] `stringify`: avoid encoding arrayformat comma when `encodeValuesOnly = true` (#424)
106
+ - [readme] remove travis badge; add github actions/codecov badges; update URLs
107
+ - [Tests] clean up stringify tests slightly
108
+ - [Docs] add note and links for coercing primitive values (#408)
109
+ - [meta] fix README.md (#399)
110
+ - [actions] backport actions from main
111
+ - [Dev Deps] backport updates from main
112
+ - [Refactor] `stringify`: reduce branching
113
+ - [meta] do not publish workflow files
114
+
78
115
  ## **6.8.2**
79
116
  - [Fix] proper comma parsing of URL-encoded commas (#361)
80
117
  - [Fix] parses comma delimited array while having percent-encoded comma treated as normal text (#336)
@@ -106,6 +143,19 @@
106
143
  - [meta] add FUNDING.yml
107
144
  - [meta] Clean up license text so it’s properly detected as BSD-3-Clause
108
145
 
146
+ ## **6.7.3**
147
+ - [Fix] `parse`: ignore `__proto__` keys (#428)
148
+ - [Fix] `stringify`: avoid encoding arrayformat comma when `encodeValuesOnly = true` (#424)
149
+ - [Robustness] `stringify`: avoid relying on a global `undefined` (#427)
150
+ - [readme] remove travis badge; add github actions/codecov badges; update URLs
151
+ - [Docs] add note and links for coercing primitive values (#408)
152
+ - [meta] fix README.md (#399)
153
+ - [meta] do not publish workflow files
154
+ - [actions] backport actions from main
155
+ - [Dev Deps] backport updates from main
156
+ - [Tests] use `nyc` for coverage
157
+ - [Tests] clean up stringify tests slightly
158
+
109
159
  ## **6.7.2**
110
160
  - [Fix] proper comma parsing of URL-encoded commas (#361)
111
161
  - [Fix] parses comma delimited array while having percent-encoded comma treated as normal text (#336)
@@ -144,6 +194,32 @@
144
194
  - [Tests] fix Buffer tests to work in node < 4.5 and node < 5.10
145
195
  - [Tests] temporarily allow coverage to fail
146
196
 
197
+ ## **6.6.1**
198
+ - [Fix] `parse`: ignore `__proto__` keys (#428)
199
+ - [Fix] fix for an impossible situation: when the formatter is called with a non-string value
200
+ - [Fix] `utils.merge`: avoid a crash with a null target and an array source
201
+ - [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source
202
+ - [Fix] correctly parse nested arrays
203
+ - [Robustness] `stringify`: avoid relying on a global `undefined` (#427)
204
+ - [Robustness] `stringify`: cache `Object.prototype.hasOwnProperty`
205
+ - [Refactor] `formats`: tiny bit of cleanup.
206
+ - [Refactor] `utils`: `isBuffer`: small tweak; add tests
207
+ - [Refactor]: `stringify`/`utils`: cache `Array.isArray`
208
+ - [Refactor] `utils`: reduce observable [[Get]]s
209
+ - [Refactor] use cached `Array.isArray`
210
+ - [Refactor] `parse`/`stringify`: make a function to normalize the options
211
+ - [readme] remove travis badge; add github actions/codecov badges; update URLs
212
+ - [Docs] Clarify the need for "arrayLimit" option
213
+ - [meta] fix README.md (#399)
214
+ - [meta] do not publish workflow files
215
+ - [meta] Clean up license text so it’s properly detected as BSD-3-Clause
216
+ - [meta] add FUNDING.yml
217
+ - [meta] Fixes typo in CHANGELOG.md
218
+ - [actions] backport actions from main
219
+ - [Tests] fix Buffer tests to work in node < 4.5 and node < 5.10
220
+ - [Tests] always use `String(x)` over `x.toString()`
221
+ - [Dev Deps] backport from main
222
+
147
223
  ## **6.6.0**
148
224
  - [New] Add support for iso-8859-1, utf8 "sentinel" and numeric entities (#268)
149
225
  - [New] move two-value combine to a `utils` function (#189)
@@ -160,6 +236,30 @@
160
236
  - [Dev Deps] update `browserify`, `eslint`, `@ljharb/eslint-config`, `iconv-lite`, `safe-publish-latest`, `tape`
161
237
  - [Tests] up to `node` `v10.10`, `v9.11`, `v8.12`, `v6.14`, `v4.9`; pin included builds to LTS
162
238
 
239
+ ## **6.5.3**
240
+ - [Fix] `parse`: ignore `__proto__` keys (#428)
241
+ - [Fix]` `utils.merge`: avoid a crash with a null target and a truthy non-array source
242
+ - [Fix] correctly parse nested arrays
243
+ - [Fix] `stringify`: fix a crash with `strictNullHandling` and a custom `filter`/`serializeDate` (#279)
244
+ - [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided
245
+ - [Fix] when `parseArrays` is false, properly handle keys ending in `[]`
246
+ - [Fix] fix for an impossible situation: when the formatter is called with a non-string value
247
+ - [Fix] `utils.merge`: avoid a crash with a null target and an array source
248
+ - [Refactor] `utils`: reduce observable [[Get]]s
249
+ - [Refactor] use cached `Array.isArray`
250
+ - [Refactor] `stringify`: Avoid arr = arr.concat(...), push to the existing instance (#269)
251
+ - [Refactor] `parse`: only need to reassign the var once
252
+ - [Robustness] `stringify`: avoid relying on a global `undefined` (#427)
253
+ - [readme] remove travis badge; add github actions/codecov badges; update URLs
254
+ - [Docs] Clean up license text so it’s properly detected as BSD-3-Clause
255
+ - [Docs] Clarify the need for "arrayLimit" option
256
+ - [meta] fix README.md (#399)
257
+ - [meta] add FUNDING.yml
258
+ - [actions] backport actions from main
259
+ - [Tests] always use `String(x)` over `x.toString()`
260
+ - [Tests] remove nonexistent tape option
261
+ - [Dev Deps] backport from main
262
+
163
263
  ## **6.5.2**
164
264
  - [Fix] use `safer-buffer` instead of `Buffer` constructor
165
265
  - [Refactor] utils: `module.exports` one thing, instead of mutating `exports` (#230)
@@ -186,6 +286,27 @@
186
286
  - [Tests] up to `node` `v8.1`, `v7.10`, `v6.11`; npm v4.6 breaks on node < v1; npm v5+ breaks on node < v4
187
287
  - [Tests] add `editorconfig-tools`
188
288
 
289
+ ## **6.4.1**
290
+ - [Fix] `parse`: ignore `__proto__` keys (#428)
291
+ - [Fix] fix for an impossible situation: when the formatter is called with a non-string value
292
+ - [Fix] use `safer-buffer` instead of `Buffer` constructor
293
+ - [Fix] `utils.merge`: avoid a crash with a null target and an array source
294
+ - [Fix]` `utils.merge`: avoid a crash with a null target and a truthy non-array source
295
+ - [Fix] `stringify`: fix a crash with `strictNullHandling` and a custom `filter`/`serializeDate` (#279)
296
+ - [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided
297
+ - [Fix] when `parseArrays` is false, properly handle keys ending in `[]`
298
+ - [Robustness] `stringify`: avoid relying on a global `undefined` (#427)
299
+ - [Refactor] use cached `Array.isArray`
300
+ - [Refactor] `stringify`: Avoid arr = arr.concat(...), push to the existing instance (#269)
301
+ - [readme] remove travis badge; add github actions/codecov badges; update URLs
302
+ - [Docs] Clarify the need for "arrayLimit" option
303
+ - [meta] fix README.md (#399)
304
+ - [meta] Clean up license text so it’s properly detected as BSD-3-Clause
305
+ - [meta] add FUNDING.yml
306
+ - [actions] backport actions from main
307
+ - [Tests] remove nonexistent tape option
308
+ - [Dev Deps] backport from main
309
+
189
310
  ## **6.4.0**
190
311
  - [New] `qs.stringify`: add `encodeValuesOnly` option
191
312
  - [Fix] follow `allowPrototypes` option during merge (#201, #201)
@@ -195,6 +316,26 @@
195
316
  - [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds
196
317
  - [eslint] reduce warnings
197
318
 
319
+ ## **6.3.3**
320
+ - [Fix] `parse`: ignore `__proto__` keys (#428)
321
+ - [Fix] fix for an impossible situation: when the formatter is called with a non-string value
322
+ - [Fix] `utils.merge`: avoid a crash with a null target and an array source
323
+ - [Fix]` `utils.merge`: avoid a crash with a null target and a truthy non-array source
324
+ - [Fix] `stringify`: fix a crash with `strictNullHandling` and a custom `filter`/`serializeDate` (#279)
325
+ - [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided
326
+ - [Fix] when `parseArrays` is false, properly handle keys ending in `[]`
327
+ - [Robustness] `stringify`: avoid relying on a global `undefined` (#427)
328
+ - [Refactor] use cached `Array.isArray`
329
+ - [Refactor] `stringify`: Avoid arr = arr.concat(...), push to the existing instance (#269)
330
+ - [Docs] Clarify the need for "arrayLimit" option
331
+ - [meta] fix README.md (#399)
332
+ - [meta] Clean up license text so it’s properly detected as BSD-3-Clause
333
+ - [meta] add FUNDING.yml
334
+ - [actions] backport actions from main
335
+ - [Tests] use `safer-buffer` instead of `Buffer` constructor
336
+ - [Tests] remove nonexistent tape option
337
+ - [Dev Deps] backport from main
338
+
198
339
  ## **6.3.2**
199
340
  - [Fix] follow `allowPrototypes` option during merge (#201, #200)
200
341
  - [Dev Deps] update `eslint`
@@ -228,6 +369,23 @@
228
369
  - [Tests] skip Object.create tests when null objects are not available
229
370
  - [Tests] Turn on eslint for test files (#175)
230
371
 
372
+ ## **6.2.4**
373
+ - [Fix] `parse`: ignore `__proto__` keys (#428)
374
+ - [Fix] `utils.merge`: avoid a crash with a null target and an array source
375
+ - [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source
376
+ - [Fix] `utils`: `merge`: fix crash when `source` is a truthy primitive & no options are provided
377
+ - [Fix] when `parseArrays` is false, properly handle keys ending in `[]`
378
+ - [Robustness] `stringify`: avoid relying on a global `undefined` (#427)
379
+ - [Refactor] use cached `Array.isArray`
380
+ - [Docs] Clarify the need for "arrayLimit" option
381
+ - [meta] fix README.md (#399)
382
+ - [meta] Clean up license text so it’s properly detected as BSD-3-Clause
383
+ - [meta] add FUNDING.yml
384
+ - [actions] backport actions from main
385
+ - [Tests] use `safer-buffer` instead of `Buffer` constructor
386
+ - [Tests] remove nonexistent tape option
387
+ - [Dev Deps] backport from main
388
+
231
389
  ## **6.2.3**
232
390
  - [Fix] follow `allowPrototypes` option during merge (#201, #200)
233
391
  - [Fix] chmod a-x
@@ -1,4 +1,4 @@
1
- # qs <sup>[![Version Badge][2]][1]</sup>
1
+ # qs <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
2
2
 
3
3
  [![github actions][actions-image]][actions-url]
4
4
  [![coverage][codecov-image]][codecov-url]
@@ -402,6 +402,8 @@ qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'comma' })
402
402
  // 'a=b,c'
403
403
  ```
404
404
 
405
+ Note: when using `arrayFormat` set to `'comma'`, you can also pass the `commaRoundTrip` option set to `true` or `false`, to append `[]` on single-item arrays, so that they can round trip through a parse.
406
+
405
407
  When objects are stringified, by default they use bracket notation:
406
408
 
407
409
  ```javascript
@@ -366,6 +366,7 @@ var stringify = function stringify(
366
366
  object,
367
367
  prefix,
368
368
  generateArrayPrefix,
369
+ commaRoundTrip,
369
370
  strictNullHandling,
370
371
  skipNulls,
371
372
  encoder,
@@ -430,7 +431,7 @@ var stringify = function stringify(
430
431
  for (var i = 0; i < valuesArray.length; ++i) {
431
432
  valuesJoined += (i === 0 ? '' : ',') + formatter(encoder(valuesArray[i], defaults.encoder, charset, 'value', format));
432
433
  }
433
- return [formatter(keyValue) + '=' + valuesJoined];
434
+ return [formatter(keyValue) + (commaRoundTrip && isArray(obj) && valuesArray.length === 1 ? '[]' : '') + '=' + valuesJoined];
434
435
  }
435
436
  return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))];
436
437
  }
@@ -454,6 +455,8 @@ var stringify = function stringify(
454
455
  objKeys = sort ? keys.sort(sort) : keys;
455
456
  }
456
457
 
458
+ var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? prefix + '[]' : prefix;
459
+
457
460
  for (var j = 0; j < objKeys.length; ++j) {
458
461
  var key = objKeys[j];
459
462
  var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];
@@ -463,8 +466,8 @@ var stringify = function stringify(
463
466
  }
464
467
 
465
468
  var keyPrefix = isArray(obj)
466
- ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(prefix, key) : prefix
467
- : prefix + (allowDots ? '.' + key : '[' + key + ']');
469
+ ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, key) : adjustedPrefix
470
+ : adjustedPrefix + (allowDots ? '.' + key : '[' + key + ']');
468
471
 
469
472
  sideChannel.set(object, step);
470
473
  var valueSideChannel = getSideChannel();
@@ -473,6 +476,7 @@ var stringify = function stringify(
473
476
  value,
474
477
  keyPrefix,
475
478
  generateArrayPrefix,
479
+ commaRoundTrip,
476
480
  strictNullHandling,
477
481
  skipNulls,
478
482
  encoder,
@@ -569,6 +573,10 @@ module.exports = function (object, opts) {
569
573
  }
570
574
 
571
575
  var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
576
+ if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
577
+ throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
578
+ }
579
+ var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip;
572
580
 
573
581
  if (!objKeys) {
574
582
  objKeys = Object.keys(obj);
@@ -589,6 +597,7 @@ module.exports = function (object, opts) {
589
597
  obj[key],
590
598
  key,
591
599
  generateArrayPrefix,
600
+ commaRoundTrip,
592
601
  options.strictNullHandling,
593
602
  options.skipNulls,
594
603
  options.encode ? options.encoder : null,
@@ -1469,8 +1478,9 @@ function addNumericSeparator(num, str) {
1469
1478
  return $replace.call(str, sepRegex, '$&_');
1470
1479
  }
1471
1480
 
1472
- var inspectCustom = require('./util.inspect').custom;
1473
- var inspectSymbol = inspectCustom && isSymbol(inspectCustom) ? inspectCustom : null;
1481
+ var utilInspect = require('./util.inspect');
1482
+ var inspectCustom = utilInspect.custom;
1483
+ var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
1474
1484
 
1475
1485
  module.exports = function inspect_(obj, options, depth, seen) {
1476
1486
  var opts = options || {};
@@ -1560,7 +1570,7 @@ module.exports = function inspect_(obj, options, depth, seen) {
1560
1570
  return inspect_(value, opts, depth + 1, seen);
1561
1571
  }
1562
1572
 
1563
- if (typeof obj === 'function') {
1573
+ if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable
1564
1574
  var name = nameOf(obj);
1565
1575
  var keys = arrObjKeys(obj, inspect);
1566
1576
  return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');
@@ -1590,15 +1600,15 @@ module.exports = function inspect_(obj, options, depth, seen) {
1590
1600
  }
1591
1601
  if (isError(obj)) {
1592
1602
  var parts = arrObjKeys(obj, inspect);
1593
- if ('cause' in obj && !isEnumerable.call(obj, 'cause')) {
1603
+ if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {
1594
1604
  return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';
1595
1605
  }
1596
1606
  if (parts.length === 0) { return '[' + String(obj) + ']'; }
1597
1607
  return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';
1598
1608
  }
1599
1609
  if (typeof obj === 'object' && customInspect) {
1600
- if (inspectSymbol && typeof obj[inspectSymbol] === 'function') {
1601
- return obj[inspectSymbol]();
1610
+ if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {
1611
+ return utilInspect(obj, { depth: maxDepth - depth });
1602
1612
  } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
1603
1613
  return obj.inspect();
1604
1614
  }
@@ -62,6 +62,7 @@ var stringify = function stringify(
62
62
  object,
63
63
  prefix,
64
64
  generateArrayPrefix,
65
+ commaRoundTrip,
65
66
  strictNullHandling,
66
67
  skipNulls,
67
68
  encoder,
@@ -126,7 +127,7 @@ var stringify = function stringify(
126
127
  for (var i = 0; i < valuesArray.length; ++i) {
127
128
  valuesJoined += (i === 0 ? '' : ',') + formatter(encoder(valuesArray[i], defaults.encoder, charset, 'value', format));
128
129
  }
129
- return [formatter(keyValue) + '=' + valuesJoined];
130
+ return [formatter(keyValue) + (commaRoundTrip && isArray(obj) && valuesArray.length === 1 ? '[]' : '') + '=' + valuesJoined];
130
131
  }
131
132
  return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))];
132
133
  }
@@ -150,6 +151,8 @@ var stringify = function stringify(
150
151
  objKeys = sort ? keys.sort(sort) : keys;
151
152
  }
152
153
 
154
+ var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? prefix + '[]' : prefix;
155
+
153
156
  for (var j = 0; j < objKeys.length; ++j) {
154
157
  var key = objKeys[j];
155
158
  var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];
@@ -159,8 +162,8 @@ var stringify = function stringify(
159
162
  }
160
163
 
161
164
  var keyPrefix = isArray(obj)
162
- ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(prefix, key) : prefix
163
- : prefix + (allowDots ? '.' + key : '[' + key + ']');
165
+ ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, key) : adjustedPrefix
166
+ : adjustedPrefix + (allowDots ? '.' + key : '[' + key + ']');
164
167
 
165
168
  sideChannel.set(object, step);
166
169
  var valueSideChannel = getSideChannel();
@@ -169,6 +172,7 @@ var stringify = function stringify(
169
172
  value,
170
173
  keyPrefix,
171
174
  generateArrayPrefix,
175
+ commaRoundTrip,
172
176
  strictNullHandling,
173
177
  skipNulls,
174
178
  encoder,
@@ -265,6 +269,10 @@ module.exports = function (object, opts) {
265
269
  }
266
270
 
267
271
  var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
272
+ if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
273
+ throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
274
+ }
275
+ var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip;
268
276
 
269
277
  if (!objKeys) {
270
278
  objKeys = Object.keys(obj);
@@ -285,6 +293,7 @@ module.exports = function (object, opts) {
285
293
  obj[key],
286
294
  key,
287
295
  generateArrayPrefix,
296
+ commaRoundTrip,
288
297
  options.strictNullHandling,
289
298
  options.skipNulls,
290
299
  options.encode ? options.encoder : null,
@@ -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.10.3",
5
+ "version": "6.11.0",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/ljharb/qs.git"
@@ -33,25 +33,27 @@
33
33
  "side-channel": "^1.0.4"
34
34
  },
35
35
  "devDependencies": {
36
- "@ljharb/eslint-config": "^20.1.0",
37
- "aud": "^1.1.5",
36
+ "@ljharb/eslint-config": "^21.0.0",
37
+ "aud": "^2.0.0",
38
38
  "browserify": "^16.5.2",
39
39
  "eclint": "^2.8.1",
40
- "eslint": "^8.6.0",
40
+ "eslint": "=8.8.0",
41
41
  "evalmd": "^0.0.19",
42
42
  "for-each": "^0.3.3",
43
- "has-symbols": "^1.0.2",
43
+ "has-symbols": "^1.0.3",
44
44
  "iconv-lite": "^0.5.1",
45
45
  "in-publish": "^2.0.1",
46
46
  "mkdirp": "^0.5.5",
47
+ "npmignore": "^0.3.0",
47
48
  "nyc": "^10.3.2",
48
- "object-inspect": "^1.12.0",
49
+ "object-inspect": "^1.12.2",
49
50
  "qs-iconv": "^1.0.4",
50
51
  "safe-publish-latest": "^2.0.0",
51
52
  "safer-buffer": "^2.1.2",
52
- "tape": "^5.4.0"
53
+ "tape": "^5.5.3"
53
54
  },
54
55
  "scripts": {
56
+ "prepack": "npmignore --auto --commentLines=autogenerated",
55
57
  "prepublishOnly": "safe-publish-latest && npm run dist",
56
58
  "prepublish": "not-in-publish || npm run prepublishOnly",
57
59
  "pretest": "npm run --silent readme && npm run --silent lint",
@@ -59,15 +61,17 @@
59
61
  "tests-only": "nyc tape 'test/**/*.js'",
60
62
  "posttest": "aud --production",
61
63
  "readme": "evalmd README.md",
62
- "postlint": "eclint check * lib/* test/* !dist/*",
63
- "lint": "eslint .",
64
+ "postlint": "eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git' | grep -v dist/)",
65
+ "lint": "eslint --ext=js,mjs .",
64
66
  "dist": "mkdirp dist && browserify --standalone Qs lib/index.js > dist/qs.js"
65
67
  },
66
68
  "license": "BSD-3-Clause",
67
- "greenkeeper": {
69
+ "publishConfig": {
68
70
  "ignore": [
69
- "iconv-lite",
70
- "mkdirp"
71
+ "!dist/*",
72
+ "bower.json",
73
+ "component.json",
74
+ ".github/workflows"
71
75
  ]
72
76
  }
73
77
  }
@@ -140,6 +140,9 @@ test('parse()', function (t) {
140
140
  t.test('limits specific array indices to arrayLimit', function (st) {
141
141
  st.deepEqual(qs.parse('a[20]=a', { arrayLimit: 20 }), { a: ['a'] });
142
142
  st.deepEqual(qs.parse('a[21]=a', { arrayLimit: 20 }), { a: { 21: 'a' } });
143
+
144
+ st.deepEqual(qs.parse('a[20]=a'), { a: ['a'] });
145
+ st.deepEqual(qs.parse('a[21]=a'), { a: { 21: 'a' } });
143
146
  st.end();
144
147
  });
145
148
 
@@ -378,6 +381,7 @@ test('parse()', function (t) {
378
381
  st.deepEqual(qs.parse('?foo=bar', { ignoreQueryPrefix: true }), { foo: 'bar' });
379
382
  st.deepEqual(qs.parse('foo=bar', { ignoreQueryPrefix: true }), { foo: 'bar' });
380
383
  st.deepEqual(qs.parse('?foo=bar', { ignoreQueryPrefix: false }), { '?foo': 'bar' });
384
+
381
385
  st.end();
382
386
  });
383
387
 
@@ -406,6 +410,16 @@ test('parse()', function (t) {
406
410
  st.deepEqual(qs.parse('foo=', { comma: true }), { foo: '' });
407
411
  st.deepEqual(qs.parse('foo', { comma: true }), { foo: '' });
408
412
  st.deepEqual(qs.parse('foo', { comma: true, strictNullHandling: true }), { foo: null });
413
+
414
+ // test cases inversed from from stringify tests
415
+ st.deepEqual(qs.parse('a[0]=c'), { a: ['c'] });
416
+ st.deepEqual(qs.parse('a[]=c'), { a: ['c'] });
417
+ st.deepEqual(qs.parse('a[]=c', { comma: true }), { a: ['c'] });
418
+
419
+ st.deepEqual(qs.parse('a[0]=c&a[1]=d'), { a: ['c', 'd'] });
420
+ st.deepEqual(qs.parse('a[]=c&a[]=d'), { a: ['c', 'd'] });
421
+ st.deepEqual(qs.parse('a=c,d', { comma: true }), { a: ['c', 'd'] });
422
+
409
423
  st.end();
410
424
  });
411
425