cdk-common 2.0.1399 → 2.0.1400

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/.jsii CHANGED
@@ -12756,6 +12756,6 @@
12756
12756
  "symbolId": "src/main:LambdaArmFunctionProps"
12757
12757
  }
12758
12758
  },
12759
- "version": "2.0.1399",
12760
- "fingerprint": "opbnuetVF4MPrPcqIMRX6Mvl4XKdhZU5nRw3aJLRUW0="
12759
+ "version": "2.0.1400",
12760
+ "fingerprint": "E/cli8hoF2bJVPZw6Ed62DsPknrCjflfux8aUWBMbDQ="
12761
12761
  }
package/lib/main.js CHANGED
@@ -38,5 +38,5 @@ class LambdaArmFunction extends constructs_1.Construct {
38
38
  }
39
39
  exports.LambdaArmFunction = LambdaArmFunction;
40
40
  _a = JSII_RTTI_SYMBOL_1;
41
- LambdaArmFunction[_a] = { fqn: "cdk-common.LambdaArmFunction", version: "2.0.1399" };
41
+ LambdaArmFunction[_a] = { fqn: "cdk-common.LambdaArmFunction", version: "2.0.1400" };
42
42
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFpbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9tYWluLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsbUNBQW1DO0FBQ25DLGlEQUFpRDtBQUNqRCwyQ0FBdUM7QUFLdkMsTUFBYSxpQkFBa0IsU0FBUSxzQkFBUztJQUU5QyxZQUFZLEtBQWdCLEVBQUUsRUFBVSxFQUFFLEtBQTRCO1FBQ3BFLEtBQUssQ0FBQyxLQUFLLEVBQUUsRUFBRSxDQUFDLENBQUM7UUFFakIsTUFBTSxlQUFlLEdBQUcsSUFBSSxHQUFHLENBQXlCO1lBQ3RELENBQUMsTUFBTSxDQUFDLE9BQU8sQ0FBQyxXQUFXLEVBQUUsbUNBQW1DLENBQUM7WUFDakUsQ0FBQyxNQUFNLENBQUMsT0FBTyxDQUFDLFdBQVcsRUFBRSxtQ0FBbUMsQ0FBQztZQUNqRSxDQUFDLE1BQU0sQ0FBQyxPQUFPLENBQUMsV0FBVyxFQUFFLG1DQUFtQyxDQUFDO1lBQ2pFLENBQUMsTUFBTSxDQUFDLE9BQU8sQ0FBQyxXQUFXLEVBQUUsa0NBQWtDLENBQUM7WUFDaEUsQ0FBQyxNQUFNLENBQUMsT0FBTyxDQUFDLFdBQVcsRUFBRSxrQ0FBa0MsQ0FBQztZQUNoRSxDQUFDLE1BQU0sQ0FBQyxPQUFPLENBQUMsV0FBVyxFQUFFLGtDQUFrQyxDQUFDO1lBQ2hFLENBQUMsTUFBTSxDQUFDLE9BQU8sQ0FBQyxXQUFXLEVBQUUsa0NBQWtDLENBQUM7WUFDaEUsQ0FBQyxNQUFNLENBQUMsT0FBTyxDQUFDLE9BQU8sRUFBRSw4QkFBOEIsQ0FBQztZQUN4RCxDQUFDLE1BQU0sQ0FBQyxPQUFPLENBQUMsT0FBTyxFQUFFLDhCQUE4QixDQUFDO1lBQ3hELENBQUMsTUFBTSxDQUFDLE9BQU8sQ0FBQyxRQUFRLEVBQUUsNkJBQTZCLENBQUM7WUFDeEQsQ0FBQyxNQUFNLENBQUMsT0FBTyxDQUFDLFFBQVEsRUFBRSwrQkFBK0IsQ0FBQztZQUMxRCxDQUFDLE1BQU0sQ0FBQyxPQUFPLENBQUMsUUFBUSxFQUFFLCtCQUErQixDQUFDO1NBQzNELENBQUMsQ0FBQztRQUVILE1BQU0sT0FBTyxHQUFHLGVBQWUsQ0FBQyxHQUFHLENBQUMsS0FBSyxDQUFDLE9BQU8sQ0FBQyxDQUFDO1FBQ25ELElBQUksT0FBTyxFQUFFLENBQUM7WUFDWixHQUFHLENBQUMsV0FBVyxDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsQ0FBQyxVQUFVLENBQUMsT0FBTyxDQUFDLENBQUM7UUFDL0MsQ0FBQzthQUFNLENBQUM7WUFDTixNQUFNLElBQUksS0FBSyxDQUFDLG1CQUFtQixLQUFLLENBQUMsT0FBTyx1R0FBdUcsQ0FBQyxDQUFDO1FBQzNKLENBQUM7UUFFRCxJQUFJLENBQUMsY0FBYyxHQUFHLElBQUksTUFBTSxDQUFDLFFBQVEsQ0FBQyxJQUFJLEVBQUUsZ0JBQWdCLEVBQUU7WUFDaEUsWUFBWSxFQUFFLEtBQUssQ0FBQyxZQUFZLElBQUksTUFBTSxDQUFDLFlBQVksQ0FBQyxNQUFNO1lBQzlELEdBQUcsS0FBSztTQUNULENBQUMsQ0FBQztJQUNMLENBQUM7O0FBL0JILDhDQWdDQyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCAqIGFzIGNkayBmcm9tICdhd3MtY2RrLWxpYic7XG5pbXBvcnQgKiBhcyBsYW1iZGEgZnJvbSAnYXdzLWNkay1saWIvYXdzLWxhbWJkYSc7XG5pbXBvcnQgeyBDb25zdHJ1Y3QgfSBmcm9tICdjb25zdHJ1Y3RzJztcbmV4cG9ydCBpbnRlcmZhY2UgTGFtYmRhQXJtRnVuY3Rpb25Qcm9wcyBleHRlbmRzIGxhbWJkYS5GdW5jdGlvblByb3BzIHtcblxufVxuXG5leHBvcnQgY2xhc3MgTGFtYmRhQXJtRnVuY3Rpb24gZXh0ZW5kcyBDb25zdHJ1Y3Qge1xuICBwdWJsaWMgcmVhZG9ubHkgbGFtYmRhRnVuY3Rpb246IGxhbWJkYS5GdW5jdGlvbjtcbiAgY29uc3RydWN0b3Ioc2NvcGU6IENvbnN0cnVjdCwgaWQ6IHN0cmluZywgcHJvcHM6TGFtYmRhQXJtRnVuY3Rpb25Qcm9wcykge1xuICAgIHN1cGVyKHNjb3BlLCBpZCk7XG5cbiAgICBjb25zdCBydW50aW1lV2FybmluZ3MgPSBuZXcgTWFwPGxhbWJkYS5SdW50aW1lLCBzdHJpbmc+KFtcbiAgICAgIFtsYW1iZGEuUnVudGltZS5OT0RFSlNfMjJfWCwgJ1lvdSBhcmUgdXNpbmcgTm9kZS5qcyAyMi54IGF0IEFSTSddLFxuICAgICAgW2xhbWJkYS5SdW50aW1lLk5PREVKU18yMF9YLCAnWW91IGFyZSB1c2luZyBOb2RlLmpzIDIwLnggYXQgQVJNJ10sXG4gICAgICBbbGFtYmRhLlJ1bnRpbWUuTk9ERUpTXzE4X1gsICdZb3UgYXJlIHVzaW5nIE5vZGUuanMgMTgueCBhdCBBUk0nXSxcbiAgICAgIFtsYW1iZGEuUnVudGltZS5QWVRIT05fM18xMywgJ1lvdSBhcmUgdXNpbmcgUHl0aG9uIDMuMTMgYXQgQVJNJ10sXG4gICAgICBbbGFtYmRhLlJ1bnRpbWUuUFlUSE9OXzNfMTIsICdZb3UgYXJlIHVzaW5nIFB5dGhvbiAzLjEyIGF0IEFSTSddLFxuICAgICAgW2xhbWJkYS5SdW50aW1lLlBZVEhPTl8zXzExLCAnWW91IGFyZSB1c2luZyBQeXRob24gMy4xMSBhdCBBUk0nXSxcbiAgICAgIFtsYW1iZGEuUnVudGltZS5QWVRIT05fM18xMCwgJ1lvdSBhcmUgdXNpbmcgUHl0aG9uIDMuMTAgYXQgQVJNJ10sXG4gICAgICBbbGFtYmRhLlJ1bnRpbWUuSkFWQV8yMSwgJ1lvdSBhcmUgdXNpbmcgSmF2YSAyMSBhdCBBUk0nXSxcbiAgICAgIFtsYW1iZGEuUnVudGltZS5KQVZBXzE3LCAnWW91IGFyZSB1c2luZyBKYXZhIDE3IGF0IEFSTSddLFxuICAgICAgW2xhbWJkYS5SdW50aW1lLkRPVE5FVF84LCAnWW91IGFyZSB1c2luZyAuTkVUIDggYXQgQVJNJ10sXG4gICAgICBbbGFtYmRhLlJ1bnRpbWUuUlVCWV8zXzQsICdZb3UgYXJlIHVzaW5nIFJ1YnkgMy40IGF0IEFSTSddLFxuICAgICAgW2xhbWJkYS5SdW50aW1lLlJVQllfM18zLCAnWW91IGFyZSB1c2luZyBSdWJ5IDMuMyBhdCBBUk0nXSxcbiAgICBdKTtcblxuICAgIGNvbnN0IHdhcm5pbmcgPSBydW50aW1lV2FybmluZ3MuZ2V0KHByb3BzLnJ1bnRpbWUpO1xuICAgIGlmICh3YXJuaW5nKSB7XG4gICAgICBjZGsuQW5ub3RhdGlvbnMub2YodGhpcykuYWRkV2FybmluZyh3YXJuaW5nKTtcbiAgICB9IGVsc2Uge1xuICAgICAgdGhyb3cgbmV3IEVycm9yKGBJbnZhbGlkIFJ1bnRpbWUgJHtwcm9wcy5ydW50aW1lfSBhdCBBUk0sIFNlZSBodHRwczovL2RvY3MuYXdzLmFtYXpvbi5jb20vbGFtYmRhL2xhdGVzdC9kZy9mb3VuZGF0aW9uLWFyY2guaHRtbD9pY21waWQ9ZG9jc19sYW1iZGFfcnNzYCk7XG4gICAgfVxuXG4gICAgdGhpcy5sYW1iZGFGdW5jdGlvbiA9IG5ldyBsYW1iZGEuRnVuY3Rpb24odGhpcywgJ0xhbWJkYUZ1bmN0aW9uJywge1xuICAgICAgYXJjaGl0ZWN0dXJlOiBwcm9wcy5hcmNoaXRlY3R1cmUgPz8gbGFtYmRhLkFyY2hpdGVjdHVyZS5BUk1fNjQsXG4gICAgICAuLi5wcm9wcyxcbiAgICB9KTtcbiAgfVxufVxuIl19
@@ -1,3 +1,7 @@
1
+ ## **6.15.0**
2
+ - [New] `parse`: add `strictMerge` option to wrap object/primitive conflicts in an array (#425, #122)
3
+ - [Fix] `duplicates` option should not apply to bracket notation keys (#514)
4
+
1
5
  ## **6.14.2**
2
6
  - [Fix] `parse`: mark overflow objects for indexed notation exceeding `arrayLimit` (#546)
3
7
  - [Fix] `arrayLimit` means max count, not max index, in `combine`/`merge`/`parseArrayValue`
@@ -30,6 +34,17 @@
30
34
  - [Dev Deps] update `es-value-fixtures`, `has-bigints`, `has-proto`, `has-symbols`
31
35
  - [Tests] increase coverage
32
36
 
37
+ ## **6.13.3**
38
+ [Fix] fix regressions from robustness refactor
39
+ [actions] update reusable workflows
40
+
41
+ ## **6.13.2**
42
+ - [Robustness] avoid `.push`, use `void`
43
+ - [readme] clarify `parseArrays` and `arrayLimit` documentation (#543)
44
+ - [readme] document that `addQueryPrefix` does not add `?` to empty output (#418)
45
+ - [readme] replace runkit CI badge with shields.io check-runs badge
46
+ - [actions] fix rebase workflow permissions
47
+
33
48
  ## **6.13.1**
34
49
  - [Fix] `stringify`: avoid a crash when a `filter` key is `null`
35
50
  - [Fix] `utils.merge`: functions should not be stringified into keys
@@ -46,6 +61,17 @@
46
61
  - [New] `parse`: add `strictDepth` option (#511)
47
62
  - [Tests] use `npm audit` instead of `aud`
48
63
 
64
+ ## **6.12.5**
65
+ - [Fix] fix regressions from robustness refactor
66
+ - [actions] update reusable workflows
67
+
68
+ ## **6.12.4**
69
+ - [Robustness] avoid `.push`, use `void`
70
+ - [readme] clarify `parseArrays` and `arrayLimit` documentation (#543)
71
+ - [readme] document that `addQueryPrefix` does not add `?` to empty output (#418)
72
+ - [readme] replace runkit CI badge with shields.io check-runs badge
73
+ - [actions] fix rebase workflow permissions
74
+
49
75
  ## **6.12.3**
50
76
  - [Fix] `parse`: properly account for `strictNullHandling` when `allowEmptyArrays`
51
77
  - [meta] fix changelog indentation
@@ -83,6 +109,17 @@
83
109
  - [Dev Deps] pin `glob`, since v10.3.8+ requires a broken `jackspeak`
84
110
  - [Dev Deps] pin `jackspeak` since 2.1.2+ depends on npm aliases, which kill the install process in npm < 6
85
111
 
112
+ ## **6.11.4**
113
+ - [Fix] fix regressions from robustness refactor
114
+ - [actions] update reusable workflows
115
+
116
+ ## **6.11.3**
117
+ - [Robustness] avoid `.push`, use `void`
118
+ - [readme] clarify `parseArrays` and `arrayLimit` documentation (#543)
119
+ - [readme] document that `addQueryPrefix` does not add `?` to empty output (#418)
120
+ - [readme] replace runkit CI badge with shields.io check-runs badge
121
+ - [actions] fix rebase workflow permissions
122
+
86
123
  ## **6.11.2**
87
124
  - [Fix] `parse`: Fix parsing when the global Object prototype is frozen (#473)
88
125
  - [Tests] add passing test cases with empty keys (#473)
@@ -100,6 +137,17 @@
100
137
  - [New] [Fix] `stringify`: revert 0e903c0; add `commaRoundTrip` option (#442)
101
138
  - [readme] fix version badge
102
139
 
140
+ ## **6.10.7**
141
+ - [Fix] fix regressions from robustness refactor
142
+ - [actions] update reusable workflows
143
+
144
+ ## **6.10.6**
145
+ - [Robustness] avoid `.push`, use `void`
146
+ - [readme] clarify `parseArrays` and `arrayLimit` documentation (#543)
147
+ - [readme] document that `addQueryPrefix` does not add `?` to empty output (#418)
148
+ - [readme] replace runkit CI badge with shields.io check-runs badge
149
+ - [actions] fix rebase workflow permissions
150
+
103
151
  ## **6.10.5**
104
152
  - [Fix] `stringify`: with `arrayFormat: comma`, properly include an explicit `[]` on a single-item array (#434)
105
153
 
@@ -137,6 +185,18 @@
137
185
  - [Tests] use `ljharb/actions/node/install` instead of `ljharb/actions/node/run`
138
186
  - [Tests] Revert "[meta] ignore eclint transitive audit warning"
139
187
 
188
+ ## **6.9.9**
189
+ - [Fix] fix regressions from robustness refactor
190
+ - [meta] add `npmignore` to autogenerate an npmignore file
191
+ - [actions] update reusable workflows
192
+
193
+ ## **6.9.8**
194
+ - [Robustness] avoid `.push`, use `void`
195
+ - [readme] clarify `parseArrays` and `arrayLimit` documentation (#543)
196
+ - [readme] document that `addQueryPrefix` does not add `?` to empty output (#418)
197
+ - [readme] replace runkit CI badge with shields.io check-runs badge
198
+ - [actions] fix rebase workflow permissions
199
+
140
200
  ## **6.9.7**
141
201
  - [Fix] `parse`: ignore `__proto__` keys (#428)
142
202
  - [Fix] `stringify`: avoid encoding arrayformat comma when `encodeValuesOnly = true` (#424)
@@ -197,6 +257,18 @@
197
257
  - [Tests] up to `node` `v12.10`, `v11.15`, `v10.16`, `v8.16`
198
258
  - [Tests] `Buffer.from` in node v5.0-v5.9 and v4.0-v4.4 requires a TypedArray
199
259
 
260
+ ## **6.8.5**
261
+ - [Fix] fix regressions from robustness refactor
262
+ - [meta] add `npmignore` to autogenerate an npmignore file
263
+ - [actions] update reusable workflows
264
+
265
+ ## **6.8.4**
266
+ - [Robustness] avoid `.push`, use `void`
267
+ - [readme] clarify `parseArrays` and `arrayLimit` documentation (#543)
268
+ - [readme] document that `addQueryPrefix` does not add `?` to empty output (#418)
269
+ - [readme] replace runkit CI badge with shields.io check-runs badge
270
+ - [actions] fix rebase workflow permissions
271
+
200
272
  ## **6.8.3**
201
273
  - [Fix] `parse`: ignore `__proto__` keys (#428)
202
274
  - [Robustness] `stringify`: avoid relying on a global `undefined` (#427)
@@ -241,6 +313,18 @@
241
313
  - [meta] add FUNDING.yml
242
314
  - [meta] Clean up license text so it’s properly detected as BSD-3-Clause
243
315
 
316
+ ## **6.7.5**
317
+ - [Fix] fix regressions from robustness refactor
318
+ - [meta] add `npmignore` to autogenerate an npmignore file
319
+ - [actions] update reusable workflows
320
+
321
+ ## **6.7.4**
322
+ - [Robustness] avoid `.push`, use `void`
323
+ - [readme] clarify `parseArrays` and `arrayLimit` documentation (#543)
324
+ - [readme] document that `addQueryPrefix` does not add `?` to empty output (#418)
325
+ - [readme] replace runkit CI badge with shields.io check-runs badge
326
+ - [actions] fix rebase workflow permissions
327
+
244
328
  ## **6.7.3**
245
329
  - [Fix] `parse`: ignore `__proto__` keys (#428)
246
330
  - [Fix] `stringify`: avoid encoding arrayformat comma when `encodeValuesOnly = true` (#424)
@@ -292,6 +376,18 @@
292
376
  - [Tests] fix Buffer tests to work in node < 4.5 and node < 5.10
293
377
  - [Tests] temporarily allow coverage to fail
294
378
 
379
+ ## **6.6.3**
380
+ - [Fix] fix regressions from robustness refactor
381
+ - [meta] add `npmignore` to autogenerate an npmignore file
382
+ - [actions] update reusable workflows
383
+
384
+ ## **6.6.2**
385
+ - [Robustness] avoid `.push`, use `void`
386
+ - [readme] clarify `parseArrays` and `arrayLimit` documentation (#543)
387
+ - [readme] document that `addQueryPrefix` does not add `?` to empty output (#418)
388
+ - [readme] replace runkit CI badge with shields.io check-runs badge
389
+ - [actions] fix rebase workflow permissions
390
+
295
391
  ## **6.6.1**
296
392
  - [Fix] `parse`: ignore `__proto__` keys (#428)
297
393
  - [Fix] fix for an impossible situation: when the formatter is called with a non-string value
@@ -334,6 +430,18 @@
334
430
  - [Dev Deps] update `browserify`, `eslint`, `@ljharb/eslint-config`, `iconv-lite`, `safe-publish-latest`, `tape`
335
431
  - [Tests] up to `node` `v10.10`, `v9.11`, `v8.12`, `v6.14`, `v4.9`; pin included builds to LTS
336
432
 
433
+ ## **6.5.5**
434
+ - [Fix] fix regressions from robustness refactor
435
+ - [meta] add `npmignore` to autogenerate an npmignore file
436
+ - [actions] update reusable workflows
437
+
438
+ ## **6.5.4**
439
+ - [Robustness] avoid `.push`, use `void`
440
+ - [readme] clarify `parseArrays` and `arrayLimit` documentation (#543)
441
+ - [readme] document that `addQueryPrefix` does not add `?` to empty output (#418)
442
+ - [readme] replace runkit CI badge with shields.io check-runs badge
443
+ - [actions] fix rebase workflow permissions
444
+
337
445
  ## **6.5.3**
338
446
  - [Fix] `parse`: ignore `__proto__` keys (#428)
339
447
  - [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source
@@ -384,6 +492,18 @@
384
492
  - [Tests] up to `node` `v8.1`, `v7.10`, `v6.11`; npm v4.6 breaks on node < v1; npm v5+ breaks on node < v4
385
493
  - [Tests] add `editorconfig-tools`
386
494
 
495
+ ## **6.4.3**
496
+ - [Fix] fix regressions from robustness refactor
497
+ - [meta] add `npmignore` to autogenerate an npmignore file
498
+ - [actions] update reusable workflows
499
+
500
+ ## **6.4.2**
501
+ - [Robustness] avoid `.push`, use `void`
502
+ - [readme] clarify `parseArrays` and `arrayLimit` documentation (#543)
503
+ - [readme] replace runkit CI badge with shields.io check-runs badge
504
+ - [readme] replace travis CI badge with shields.io check-runs badge
505
+ - [actions] fix rebase workflow permissions
506
+
387
507
  ## **6.4.1**
388
508
  - [Fix] `parse`: ignore `__proto__` keys (#428)
389
509
  - [Fix] fix for an impossible situation: when the formatter is called with a non-string value
@@ -414,6 +534,17 @@
414
534
  - [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds
415
535
  - [eslint] reduce warnings
416
536
 
537
+ ## **6.3.5**
538
+ - [Fix] fix regressions from robustness refactor
539
+ - [meta] add `npmignore` to autogenerate an npmignore file
540
+ - [actions] update reusable workflows
541
+
542
+ ## **6.3.4**
543
+ - [Robustness] avoid `.push`, use `void`
544
+ - [readme] clarify `parseArrays` and `arrayLimit` documentation (#543)
545
+ - [readme] replace travis CI badge with shields.io check-runs badge
546
+ - [actions] fix rebase workflow permissions
547
+
417
548
  ## **6.3.3**
418
549
  - [Fix] `parse`: ignore `__proto__` keys (#428)
419
550
  - [Fix] fix for an impossible situation: when the formatter is called with a non-string value
@@ -467,6 +598,17 @@
467
598
  - [Tests] skip Object.create tests when null objects are not available
468
599
  - [Tests] Turn on eslint for test files (#175)
469
600
 
601
+ ## **6.2.6**
602
+ - [Fix] fix regression from robustness refactor
603
+ - [meta] add `npmignore` to autogenerate an npmignore file
604
+ - [actions] update reusable workflows
605
+
606
+ ## **6.2.5**
607
+ - [Robustness] avoid `.push`, use `void`
608
+ - [readme] clarify `parseArrays` and `arrayLimit` documentation (#543)
609
+ - [readme] replace travis CI badge with shields.io check-runs badge
610
+ - [actions] fix rebase workflow permissions
611
+
470
612
  ## **6.2.4**
471
613
  - [Fix] `parse`: ignore `__proto__` keys (#428)
472
614
  - [Fix] `utils.merge`: avoid a crash with a null target and an array source
@@ -505,6 +647,16 @@
505
647
  - [New] add "encoder" and "decoder" options, for custom param encoding/decoding (#160)
506
648
  - [Fix] fix compacting of nested sparse arrays (#150)
507
649
 
650
+ ## **6.1.4**
651
+ - [Fix] fix regression from robustness refactor
652
+ - [meta] add `npmignore` to autogenerate an npmignore file
653
+ - [actions] update reusable workflows
654
+
655
+ ## **6.1.3**
656
+ - [Robustness] avoid `.push`, use `void`
657
+ - [readme] clarify `parseArrays` and `arrayLimit` documentation (#543)
658
+ - [readme] replace travis CI badge with shields.io check-runs badge
659
+
508
660
  ## **6.1.2**
509
661
  - [Fix] follow `allowPrototypes` option during merge (#201, #200)
510
662
  - [Fix] chmod a-x
@@ -519,6 +671,16 @@
519
671
  - [Fix] "sort" option should work at a depth of 3 or more (#151)
520
672
  - [Fix] Restore `dist` directory; will be removed in v7 (#148)
521
673
 
674
+ ## **6.0.6**
675
+ - [Fix] fix regression from robustness refactor
676
+ - [meta] add `npmignore` to autogenerate an npmignore file
677
+ - [actions] update reusable workflows
678
+
679
+ ## **6.0.5**
680
+ - [Robustness] avoid `.push`, use `void`
681
+ - [readme] clarify `parseArrays` and `arrayLimit` documentation (#543)
682
+ - [readme] replace travis CI badge with shields.io check-runs badge
683
+
522
684
  ## **6.0.4**
523
685
  - [Fix] follow `allowPrototypes` option during merge (#201, #200)
524
686
  - [Fix] chmod a-x
@@ -197,6 +197,11 @@ assert.deepEqual(qs.parse('foo=bar&foo=baz', { duplicates: 'first' }), { foo: 'b
197
197
  assert.deepEqual(qs.parse('foo=bar&foo=baz', { duplicates: 'last' }), { foo: 'baz' });
198
198
  ```
199
199
 
200
+ Note that keys with bracket notation (`[]`) always combine into arrays, regardless of the `duplicates` setting:
201
+ ```javascript
202
+ assert.deepEqual(qs.parse('a=1&a=2&b[]=1&b[]=2', { duplicates: 'last' }), { a: '2', b: ['1', '2'] });
203
+ ```
204
+
200
205
  If you have to deal with legacy browsers or services, there's also support for decoding percent-encoded octets as iso-8859-1:
201
206
 
202
207
  ```javascript
@@ -325,6 +330,19 @@ var mixedNotation = qs.parse('a[0]=b&a[b]=c');
325
330
  assert.deepEqual(mixedNotation, { a: { '0': 'b', b: 'c' } });
326
331
  ```
327
332
 
333
+ When a key appears as both a plain value and an object, **qs** will by default wrap the conflicting values in an array (`strictMerge` defaults to `true`):
334
+
335
+ ```javascript
336
+ assert.deepEqual(qs.parse('a[b]=c&a=d'), { a: [{ b: 'c' }, 'd'] });
337
+ assert.deepEqual(qs.parse('a=d&a[b]=c'), { a: ['d', { b: 'c' }] });
338
+ ```
339
+
340
+ To restore the legacy behavior (where the primitive is used as a key with value `true`), set `strictMerge` to `false`:
341
+
342
+ ```javascript
343
+ assert.deepEqual(qs.parse('a[b]=c&a=d', { strictMerge: false }), { a: { b: 'c', d: true } });
344
+ ```
345
+
328
346
  You can also create arrays of objects:
329
347
 
330
348
  ```javascript
@@ -5,13 +5,13 @@
5
5
  "use strict";var stringify=require(4),parse=require(3),formats=require(1);module.exports={formats:formats,parse:parse,stringify:stringify};
6
6
 
7
7
  },{"1":1,"3":3,"4":4}],3:[function(require,module,exports){
8
- "use strict";var utils=require(5),has=Object.prototype.hasOwnProperty,isArray=Array.isArray,defaults={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:utils.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},interpretNumericEntities=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},parseArrayValue=function(e,t,r){if(e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1)return e.split(",");if(t.throwOnLimitExceeded&&r>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(1===t.arrayLimit?"":"s")+" allowed in an array.");return e},isoSentinel="utf8=%26%2310003%3B",charsetSentinel="utf8=%E2%9C%93",parseValues=function parseQueryStringValues(e,t){var r={__proto__:null},i=t.ignoreQueryPrefix?e.replace(/^\?/,""):e;i=i.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var a=t.parameterLimit===1/0?void 0:t.parameterLimit,o=i.split(t.delimiter,t.throwOnLimitExceeded?a+1:a);if(t.throwOnLimitExceeded&&o.length>a)throw new RangeError("Parameter limit exceeded. Only "+a+" parameter"+(1===a?"":"s")+" allowed.");var l,n=-1,s=t.charset;if(t.charsetSentinel)for(l=0;l<o.length;++l)0===o[l].indexOf("utf8=")&&(o[l]===charsetSentinel?s="utf-8":o[l]===isoSentinel&&(s="iso-8859-1"),n=l,l=o.length);for(l=0;l<o.length;++l)if(l!==n){var d,p,c=o[l],u=c.indexOf("]="),y=-1===u?c.indexOf("="):u+1;if(-1===y?(d=t.decoder(c,defaults.decoder,s,"key"),p=t.strictNullHandling?null:""):null!==(d=t.decoder(c.slice(0,y),defaults.decoder,s,"key"))&&(p=utils.maybeMap(parseArrayValue(c.slice(y+1),t,isArray(r[d])?r[d].length:0),function(e){return t.decoder(e,defaults.decoder,s,"value")})),p&&t.interpretNumericEntities&&"iso-8859-1"===s&&(p=interpretNumericEntities(String(p))),c.indexOf("[]=")>-1&&(p=isArray(p)?[p]:p),t.comma&&isArray(p)&&p.length>t.arrayLimit){if(t.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(1===t.arrayLimit?"":"s")+" allowed in an array.");p=utils.combine([],p,t.arrayLimit,t.plainObjects)}if(null!==d){var f=has.call(r,d);f&&"combine"===t.duplicates?r[d]=utils.combine(r[d],p,t.arrayLimit,t.plainObjects):f&&"last"!==t.duplicates||(r[d]=p)}}return r},parseObject=function(e,t,r,i){var a=0;if(e.length>0&&"[]"===e[e.length-1]){var o=e.slice(0,-1).join("");a=Array.isArray(t)&&t[o]?t[o].length:0}for(var l=i?t:parseArrayValue(t,r,a),n=e.length-1;n>=0;--n){var s,d=e[n];if("[]"===d&&r.parseArrays)s=utils.isOverflow(l)?l:r.allowEmptyArrays&&(""===l||r.strictNullHandling&&null===l)?[]:utils.combine([],l,r.arrayLimit,r.plainObjects);else{s=r.plainObjects?{__proto__:null}:{};var p="["===d.charAt(0)&&"]"===d.charAt(d.length-1)?d.slice(1,-1):d,c=r.decodeDotInKeys?p.replace(/%2E/g,"."):p,u=parseInt(c,10),y=!isNaN(u)&&d!==c&&String(u)===c&&u>=0&&r.parseArrays;if(r.parseArrays||""!==c)if(y&&u<r.arrayLimit)(s=[])[u]=l;else{if(y&&r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(1===r.arrayLimit?"":"s")+" allowed in an array.");y?(s[u]=l,utils.markOverflow(s,u)):"__proto__"!==c&&(s[c]=l)}else s={0:l}}l=s}return l},splitKeyIntoSegments=function splitKeyIntoSegments(e,t){var r=t.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e;if(t.depth<=0){if(!t.plainObjects&&has.call(Object.prototype,r)&&!t.allowPrototypes)return;return[r]}var i=/(\[[^[\]]*])/g,a=/(\[[^[\]]*])/.exec(r),o=a?r.slice(0,a.index):r,l=[];if(o){if(!t.plainObjects&&has.call(Object.prototype,o)&&!t.allowPrototypes)return;l[l.length]=o}for(var n=0;null!==(a=i.exec(r))&&n<t.depth;){n+=1;var s=a[1].slice(1,-1);if(!t.plainObjects&&has.call(Object.prototype,s)&&!t.allowPrototypes)return;l[l.length]=a[1]}if(a){if(!0===t.strictDepth)throw new RangeError("Input depth exceeded depth option of "+t.depth+" and strictDepth is true");l[l.length]="["+r.slice(a.index)+"]"}return l},parseKeys=function parseQueryStringKeys(e,t,r,i){if(e){var a=splitKeyIntoSegments(e,r);if(a)return parseObject(a,t,r,i)}},normalizeParseOptions=function normalizeParseOptions(e){if(!e)return defaults;if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==e.decodeDotInKeys&&"boolean"!=typeof e.decodeDotInKeys)throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(void 0!==e.throwOnLimitExceeded&&"boolean"!=typeof e.throwOnLimitExceeded)throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var t=void 0===e.charset?defaults.charset:e.charset,r=void 0===e.duplicates?defaults.duplicates:e.duplicates;if("combine"!==r&&"first"!==r&&"last"!==r)throw new TypeError("The duplicates option must be either combine, first, or last");return{allowDots:void 0===e.allowDots?!0===e.decodeDotInKeys||defaults.allowDots:!!e.allowDots,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:defaults.allowEmptyArrays,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:defaults.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:defaults.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:defaults.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:defaults.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:defaults.comma,decodeDotInKeys:"boolean"==typeof e.decodeDotInKeys?e.decodeDotInKeys:defaults.decodeDotInKeys,decoder:"function"==typeof e.decoder?e.decoder:defaults.decoder,delimiter:"string"==typeof e.delimiter||utils.isRegExp(e.delimiter)?e.delimiter:defaults.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:defaults.depth,duplicates:r,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:defaults.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:defaults.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:defaults.plainObjects,strictDepth:"boolean"==typeof e.strictDepth?!!e.strictDepth:defaults.strictDepth,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:defaults.strictNullHandling,throwOnLimitExceeded:"boolean"==typeof e.throwOnLimitExceeded&&e.throwOnLimitExceeded}};module.exports=function(e,t){var r=normalizeParseOptions(t);if(""===e||null==e)return r.plainObjects?{__proto__:null}:{};for(var i="string"==typeof e?parseValues(e,r):e,a=r.plainObjects?{__proto__:null}:{},o=Object.keys(i),l=0;l<o.length;++l){var n=o[l],s=parseKeys(n,i[n],r,"string"==typeof e);a=utils.merge(a,s,r)}return!0===r.allowSparse?a:utils.compact(a)};
8
+ "use strict";var utils=require(5),has=Object.prototype.hasOwnProperty,isArray=Array.isArray,defaults={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:utils.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},interpretNumericEntities=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},parseArrayValue=function(e,t,r){if(e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1)return e.split(",");if(t.throwOnLimitExceeded&&r>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(1===t.arrayLimit?"":"s")+" allowed in an array.");return e},isoSentinel="utf8=%26%2310003%3B",charsetSentinel="utf8=%E2%9C%93",parseValues=function parseQueryStringValues(e,t){var r={__proto__:null},i=t.ignoreQueryPrefix?e.replace(/^\?/,""):e;i=i.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var a=t.parameterLimit===1/0?void 0:t.parameterLimit,o=i.split(t.delimiter,t.throwOnLimitExceeded?a+1:a);if(t.throwOnLimitExceeded&&o.length>a)throw new RangeError("Parameter limit exceeded. Only "+a+" parameter"+(1===a?"":"s")+" allowed.");var l,n=-1,s=t.charset;if(t.charsetSentinel)for(l=0;l<o.length;++l)0===o[l].indexOf("utf8=")&&(o[l]===charsetSentinel?s="utf-8":o[l]===isoSentinel&&(s="iso-8859-1"),n=l,l=o.length);for(l=0;l<o.length;++l)if(l!==n){var d,c,p=o[l],u=p.indexOf("]="),y=-1===u?p.indexOf("="):u+1;if(-1===y?(d=t.decoder(p,defaults.decoder,s,"key"),c=t.strictNullHandling?null:""):null!==(d=t.decoder(p.slice(0,y),defaults.decoder,s,"key"))&&(c=utils.maybeMap(parseArrayValue(p.slice(y+1),t,isArray(r[d])?r[d].length:0),function(e){return t.decoder(e,defaults.decoder,s,"value")})),c&&t.interpretNumericEntities&&"iso-8859-1"===s&&(c=interpretNumericEntities(String(c))),p.indexOf("[]=")>-1&&(c=isArray(c)?[c]:c),t.comma&&isArray(c)&&c.length>t.arrayLimit){if(t.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(1===t.arrayLimit?"":"s")+" allowed in an array.");c=utils.combine([],c,t.arrayLimit,t.plainObjects)}if(null!==d){var f=has.call(r,d);f&&("combine"===t.duplicates||p.indexOf("[]=")>-1)?r[d]=utils.combine(r[d],c,t.arrayLimit,t.plainObjects):f&&"last"!==t.duplicates||(r[d]=c)}}return r},parseObject=function(e,t,r,i){var a=0;if(e.length>0&&"[]"===e[e.length-1]){var o=e.slice(0,-1).join("");a=Array.isArray(t)&&t[o]?t[o].length:0}for(var l=i?t:parseArrayValue(t,r,a),n=e.length-1;n>=0;--n){var s,d=e[n];if("[]"===d&&r.parseArrays)s=utils.isOverflow(l)?l:r.allowEmptyArrays&&(""===l||r.strictNullHandling&&null===l)?[]:utils.combine([],l,r.arrayLimit,r.plainObjects);else{s=r.plainObjects?{__proto__:null}:{};var c="["===d.charAt(0)&&"]"===d.charAt(d.length-1)?d.slice(1,-1):d,p=r.decodeDotInKeys?c.replace(/%2E/g,"."):c,u=parseInt(p,10),y=!isNaN(u)&&d!==p&&String(u)===p&&u>=0&&r.parseArrays;if(r.parseArrays||""!==p)if(y&&u<r.arrayLimit)(s=[])[u]=l;else{if(y&&r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(1===r.arrayLimit?"":"s")+" allowed in an array.");y?(s[u]=l,utils.markOverflow(s,u)):"__proto__"!==p&&(s[p]=l)}else s={0:l}}l=s}return l},splitKeyIntoSegments=function splitKeyIntoSegments(e,t){var r=t.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e;if(t.depth<=0){if(!t.plainObjects&&has.call(Object.prototype,r)&&!t.allowPrototypes)return;return[r]}var i=/(\[[^[\]]*])/g,a=/(\[[^[\]]*])/.exec(r),o=a?r.slice(0,a.index):r,l=[];if(o){if(!t.plainObjects&&has.call(Object.prototype,o)&&!t.allowPrototypes)return;l[l.length]=o}for(var n=0;null!==(a=i.exec(r))&&n<t.depth;){n+=1;var s=a[1].slice(1,-1);if(!t.plainObjects&&has.call(Object.prototype,s)&&!t.allowPrototypes)return;l[l.length]=a[1]}if(a){if(!0===t.strictDepth)throw new RangeError("Input depth exceeded depth option of "+t.depth+" and strictDepth is true");l[l.length]="["+r.slice(a.index)+"]"}return l},parseKeys=function parseQueryStringKeys(e,t,r,i){if(e){var a=splitKeyIntoSegments(e,r);if(a)return parseObject(a,t,r,i)}},normalizeParseOptions=function normalizeParseOptions(e){if(!e)return defaults;if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==e.decodeDotInKeys&&"boolean"!=typeof e.decodeDotInKeys)throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(void 0!==e.throwOnLimitExceeded&&"boolean"!=typeof e.throwOnLimitExceeded)throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var t=void 0===e.charset?defaults.charset:e.charset,r=void 0===e.duplicates?defaults.duplicates:e.duplicates;if("combine"!==r&&"first"!==r&&"last"!==r)throw new TypeError("The duplicates option must be either combine, first, or last");return{allowDots:void 0===e.allowDots?!0===e.decodeDotInKeys||defaults.allowDots:!!e.allowDots,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:defaults.allowEmptyArrays,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:defaults.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:defaults.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:defaults.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:defaults.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:defaults.comma,decodeDotInKeys:"boolean"==typeof e.decodeDotInKeys?e.decodeDotInKeys:defaults.decodeDotInKeys,decoder:"function"==typeof e.decoder?e.decoder:defaults.decoder,delimiter:"string"==typeof e.delimiter||utils.isRegExp(e.delimiter)?e.delimiter:defaults.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:defaults.depth,duplicates:r,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:defaults.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:defaults.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:defaults.plainObjects,strictDepth:"boolean"==typeof e.strictDepth?!!e.strictDepth:defaults.strictDepth,strictMerge:"boolean"==typeof e.strictMerge?!!e.strictMerge:defaults.strictMerge,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:defaults.strictNullHandling,throwOnLimitExceeded:"boolean"==typeof e.throwOnLimitExceeded&&e.throwOnLimitExceeded}};module.exports=function(e,t){var r=normalizeParseOptions(t);if(""===e||null==e)return r.plainObjects?{__proto__:null}:{};for(var i="string"==typeof e?parseValues(e,r):e,a=r.plainObjects?{__proto__:null}:{},o=Object.keys(i),l=0;l<o.length;++l){var n=o[l],s=parseKeys(n,i[n],r,"string"==typeof e);a=utils.merge(a,s,r)}return!0===r.allowSparse?a:utils.compact(a)};
9
9
 
10
10
  },{"5":5}],4:[function(require,module,exports){
11
11
  "use strict";var getSideChannel=require(46),utils=require(5),formats=require(1),has=Object.prototype.hasOwnProperty,arrayPrefixGenerators={brackets:function brackets(e){return e+"[]"},comma:"comma",indices:function indices(e,r){return e+"["+r+"]"},repeat:function repeat(e){return e}},isArray=Array.isArray,push=Array.prototype.push,pushToArray=function(e,r){push.apply(e,isArray(r)?r:[r])},toISO=Date.prototype.toISOString,defaultFormat=formats.default,defaults={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:utils.encode,encodeValuesOnly:!1,filter:void 0,format:defaultFormat,formatter:formats.formatters[defaultFormat],indices:!1,serializeDate:function serializeDate(e){return toISO.call(e)},skipNulls:!1,strictNullHandling:!1},isNonNullishPrimitive=function isNonNullishPrimitive(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||"symbol"==typeof e||"bigint"==typeof e},sentinel={},stringify=function stringify(e,r,t,o,a,n,i,l,s,f,u,d,y,c,p,m,h,v){for(var g=e,w=v,b=0,A=!1;void 0!==(w=w.get(sentinel))&&!A;){var D=w.get(e);if(b+=1,void 0!==D){if(D===b)throw new RangeError("Cyclic object value");A=!0}void 0===w.get(sentinel)&&(b=0)}if("function"==typeof f?g=f(r,g):g instanceof Date?g=y(g):"comma"===t&&isArray(g)&&(g=utils.maybeMap(g,function(e){return e instanceof Date?y(e):e})),null===g){if(n)return s&&!m?s(r,defaults.encoder,h,"key",c):r;g=""}if(isNonNullishPrimitive(g)||utils.isBuffer(g))return s?[p(m?r:s(r,defaults.encoder,h,"key",c))+"="+p(s(g,defaults.encoder,h,"value",c))]:[p(r)+"="+p(String(g))];var S,E=[];if(void 0===g)return E;if("comma"===t&&isArray(g))m&&s&&(g=utils.maybeMap(g,s)),S=[{value:g.length>0?g.join(",")||null:void 0}];else if(isArray(f))S=f;else{var N=Object.keys(g);S=u?N.sort(u):N}var T=l?String(r).replace(/\./g,"%2E"):String(r),O=o&&isArray(g)&&1===g.length?T+"[]":T;if(a&&isArray(g)&&0===g.length)return O+"[]";for(var k=0;k<S.length;++k){var I=S[k],P="object"==typeof I&&I&&void 0!==I.value?I.value:g[I];if(!i||null!==P){var x=d&&l?String(I).replace(/\./g,"%2E"):String(I),z=isArray(g)?"function"==typeof t?t(O,x):O:O+(d?"."+x:"["+x+"]");v.set(e,b);var K=getSideChannel();K.set(sentinel,v),pushToArray(E,stringify(P,z,t,o,a,n,i,l,"comma"===t&&m&&isArray(g)?null:s,f,u,d,y,c,p,m,h,K))}}return E},normalizeStringifyOptions=function normalizeStringifyOptions(e){if(!e)return defaults;if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==e.encodeDotInKeys&&"boolean"!=typeof e.encodeDotInKeys)throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var r=e.charset||defaults.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var t=formats.default;if(void 0!==e.format){if(!has.call(formats.formatters,e.format))throw new TypeError("Unknown format option provided.");t=e.format}var o,a=formats.formatters[t],n=defaults.filter;if(("function"==typeof e.filter||isArray(e.filter))&&(n=e.filter),o=e.arrayFormat in arrayPrefixGenerators?e.arrayFormat:"indices"in e?e.indices?"indices":"repeat":defaults.arrayFormat,"commaRoundTrip"in e&&"boolean"!=typeof e.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var i=void 0===e.allowDots?!0===e.encodeDotInKeys||defaults.allowDots:!!e.allowDots;return{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:defaults.addQueryPrefix,allowDots:i,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:defaults.allowEmptyArrays,arrayFormat:o,charset:r,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:defaults.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:void 0===e.delimiter?defaults.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:defaults.encode,encodeDotInKeys:"boolean"==typeof e.encodeDotInKeys?e.encodeDotInKeys:defaults.encodeDotInKeys,encoder:"function"==typeof e.encoder?e.encoder:defaults.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:defaults.encodeValuesOnly,filter:n,format:t,formatter:a,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:defaults.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:defaults.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:defaults.strictNullHandling}};module.exports=function(e,r){var t,o=e,a=normalizeStringifyOptions(r);"function"==typeof a.filter?o=(0,a.filter)("",o):isArray(a.filter)&&(t=a.filter);var n=[];if("object"!=typeof o||null===o)return"";var i=arrayPrefixGenerators[a.arrayFormat],l="comma"===i&&a.commaRoundTrip;t||(t=Object.keys(o)),a.sort&&t.sort(a.sort);for(var s=getSideChannel(),f=0;f<t.length;++f){var u=t[f],d=o[u];a.skipNulls&&null===d||pushToArray(n,stringify(d,u,i,l,a.allowEmptyArrays,a.strictNullHandling,a.skipNulls,a.encodeDotInKeys,a.encode?a.encoder:null,a.filter,a.sort,a.allowDots,a.serializeDate,a.format,a.formatter,a.encodeValuesOnly,a.charset,s))}var y=n.join(a.delimiter),c=!0===a.addQueryPrefix?"?":"";return a.charsetSentinel&&("iso-8859-1"===a.charset?c+="utf8=%26%2310003%3B&":c+="utf8=%E2%9C%93&"),y.length>0?c+y:""};
12
12
 
13
13
  },{"1":1,"46":46,"5":5}],5:[function(require,module,exports){
14
- "use strict";var formats=require(1),getSideChannel=require(46),has=Object.prototype.hasOwnProperty,isArray=Array.isArray,overflowChannel=getSideChannel(),markOverflow=function markOverflow(e,r){return overflowChannel.set(e,r),e},isOverflow=function isOverflow(e){return overflowChannel.has(e)},getMaxIndex=function getMaxIndex(e){return overflowChannel.get(e)},setMaxIndex=function setMaxIndex(e,r){overflowChannel.set(e,r)},hexTable=function(){for(var e=[],r=0;r<256;++r)e[e.length]="%"+((r<16?"0":"")+r.toString(16)).toUpperCase();return e}(),compactQueue=function compactQueue(e){for(;e.length>1;){var r=e.pop(),t=r.obj[r.prop];if(isArray(t)){for(var n=[],o=0;o<t.length;++o)void 0!==t[o]&&(n[n.length]=t[o]);r.obj[r.prop]=n}}},arrayToObject=function arrayToObject(e,r){for(var t=r&&r.plainObjects?{__proto__:null}:{},n=0;n<e.length;++n)void 0!==e[n]&&(t[n]=e[n]);return t},merge=function merge(e,r,t){if(!r)return e;if("object"!=typeof r&&"function"!=typeof r){if(isArray(e)){var n=e.length;if(t&&"number"==typeof t.arrayLimit&&n>t.arrayLimit)return markOverflow(arrayToObject(e.concat(r),t),n);e[n]=r}else{if(!e||"object"!=typeof e)return[e,r];if(isOverflow(e)){var o=getMaxIndex(e)+1;e[o]=r,setMaxIndex(e,o)}else(t&&(t.plainObjects||t.allowPrototypes)||!has.call(Object.prototype,r))&&(e[r]=!0)}return e}if(!e||"object"!=typeof e){if(isOverflow(r)){for(var a=Object.keys(r),i=t&&t.plainObjects?{__proto__:null,0:e}:{0:e},c=0;c<a.length;c++)i[parseInt(a[c],10)+1]=r[a[c]];return markOverflow(i,getMaxIndex(r)+1)}var l=[e].concat(r);return t&&"number"==typeof t.arrayLimit&&l.length>t.arrayLimit?markOverflow(arrayToObject(l,t),l.length-1):l}var f=e;return isArray(e)&&!isArray(r)&&(f=arrayToObject(e,t)),isArray(e)&&isArray(r)?(r.forEach(function(r,n){if(has.call(e,n)){var o=e[n];o&&"object"==typeof o&&r&&"object"==typeof r?e[n]=merge(o,r,t):e[e.length]=r}else e[n]=r}),e):Object.keys(r).reduce(function(e,n){var o=r[n];if(has.call(e,n)?e[n]=merge(e[n],o,t):e[n]=o,isOverflow(r)&&!isOverflow(e)&&markOverflow(e,getMaxIndex(r)),isOverflow(e)){var a=parseInt(n,10);String(a)===n&&a>=0&&a>getMaxIndex(e)&&setMaxIndex(e,a)}return e},f)},assign=function assignSingleSource(e,r){return Object.keys(r).reduce(function(e,t){return e[t]=r[t],e},e)},decode=function(e,r,t){var n=e.replace(/\+/g," ");if("iso-8859-1"===t)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(e){return n}},limit=1024,encode=function encode(e,r,t,n,o){if(0===e.length)return e;var a=e;if("symbol"==typeof e?a=Symbol.prototype.toString.call(e):"string"!=typeof e&&(a=String(e)),"iso-8859-1"===t)return escape(a).replace(/%u[0-9a-f]{4}/gi,function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"});for(var i="",c=0;c<a.length;c+=limit){for(var l=a.length>=limit?a.slice(c,c+limit):a,f=[],s=0;s<l.length;++s){var u=l.charCodeAt(s);45===u||46===u||95===u||126===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||o===formats.RFC1738&&(40===u||41===u)?f[f.length]=l.charAt(s):u<128?f[f.length]=hexTable[u]:u<2048?f[f.length]=hexTable[192|u>>6]+hexTable[128|63&u]:u<55296||u>=57344?f[f.length]=hexTable[224|u>>12]+hexTable[128|u>>6&63]+hexTable[128|63&u]:(s+=1,u=65536+((1023&u)<<10|1023&l.charCodeAt(s)),f[f.length]=hexTable[240|u>>18]+hexTable[128|u>>12&63]+hexTable[128|u>>6&63]+hexTable[128|63&u])}i+=f.join("")}return i},compact=function compact(e){for(var r=[{obj:{o:e},prop:"o"}],t=[],n=0;n<r.length;++n)for(var o=r[n],a=o.obj[o.prop],i=Object.keys(a),c=0;c<i.length;++c){var l=i[c],f=a[l];"object"==typeof f&&null!==f&&-1===t.indexOf(f)&&(r[r.length]={obj:a,prop:l},t[t.length]=f)}return compactQueue(r),e},isRegExp=function isRegExp(e){return"[object RegExp]"===Object.prototype.toString.call(e)},isBuffer=function isBuffer(e){return!(!e||"object"!=typeof e||!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e)))},combine=function combine(e,r,t,n){if(isOverflow(e)){var o=getMaxIndex(e)+1;return e[o]=r,setMaxIndex(e,o),e}var a=[].concat(e,r);return a.length>t?markOverflow(arrayToObject(a,{plainObjects:n}),a.length-1):a},maybeMap=function maybeMap(e,r){if(isArray(e)){for(var t=[],n=0;n<e.length;n+=1)t[t.length]=r(e[n]);return t}return r(e)};module.exports={/* common-shake removed: arrayToObject:arrayToObject *//* common-shake removed: assign:assign */combine:combine,compact:compact,decode:decode,encode:encode,isBuffer:isBuffer,isOverflow:isOverflow,isRegExp:isRegExp,markOverflow:markOverflow,maybeMap:maybeMap,merge:merge};
14
+ "use strict";var formats=require(1),getSideChannel=require(46),has=Object.prototype.hasOwnProperty,isArray=Array.isArray,overflowChannel=getSideChannel(),markOverflow=function markOverflow(e,r){return overflowChannel.set(e,r),e},isOverflow=function isOverflow(e){return overflowChannel.has(e)},getMaxIndex=function getMaxIndex(e){return overflowChannel.get(e)},setMaxIndex=function setMaxIndex(e,r){overflowChannel.set(e,r)},hexTable=function(){for(var e=[],r=0;r<256;++r)e[e.length]="%"+((r<16?"0":"")+r.toString(16)).toUpperCase();return e}(),compactQueue=function compactQueue(e){for(;e.length>1;){var r=e.pop(),t=r.obj[r.prop];if(isArray(t)){for(var n=[],o=0;o<t.length;++o)void 0!==t[o]&&(n[n.length]=t[o]);r.obj[r.prop]=n}}},arrayToObject=function arrayToObject(e,r){for(var t=r&&r.plainObjects?{__proto__:null}:{},n=0;n<e.length;++n)void 0!==e[n]&&(t[n]=e[n]);return t},merge=function merge(e,r,t){if(!r)return e;if("object"!=typeof r&&"function"!=typeof r){if(isArray(e)){var n=e.length;if(t&&"number"==typeof t.arrayLimit&&n>t.arrayLimit)return markOverflow(arrayToObject(e.concat(r),t),n);e[n]=r}else{if(!e||"object"!=typeof e)return[e,r];if(isOverflow(e)){var o=getMaxIndex(e)+1;e[o]=r,setMaxIndex(e,o)}else{if(t&&t.strictMerge)return[e,r];(t&&(t.plainObjects||t.allowPrototypes)||!has.call(Object.prototype,r))&&(e[r]=!0)}}return e}if(!e||"object"!=typeof e){if(isOverflow(r)){for(var a=Object.keys(r),i=t&&t.plainObjects?{__proto__:null,0:e}:{0:e},c=0;c<a.length;c++)i[parseInt(a[c],10)+1]=r[a[c]];return markOverflow(i,getMaxIndex(r)+1)}var l=[e].concat(r);return t&&"number"==typeof t.arrayLimit&&l.length>t.arrayLimit?markOverflow(arrayToObject(l,t),l.length-1):l}var f=e;return isArray(e)&&!isArray(r)&&(f=arrayToObject(e,t)),isArray(e)&&isArray(r)?(r.forEach(function(r,n){if(has.call(e,n)){var o=e[n];o&&"object"==typeof o&&r&&"object"==typeof r?e[n]=merge(o,r,t):e[e.length]=r}else e[n]=r}),e):Object.keys(r).reduce(function(e,n){var o=r[n];if(has.call(e,n)?e[n]=merge(e[n],o,t):e[n]=o,isOverflow(r)&&!isOverflow(e)&&markOverflow(e,getMaxIndex(r)),isOverflow(e)){var a=parseInt(n,10);String(a)===n&&a>=0&&a>getMaxIndex(e)&&setMaxIndex(e,a)}return e},f)},assign=function assignSingleSource(e,r){return Object.keys(r).reduce(function(e,t){return e[t]=r[t],e},e)},decode=function(e,r,t){var n=e.replace(/\+/g," ");if("iso-8859-1"===t)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(e){return n}},limit=1024,encode=function encode(e,r,t,n,o){if(0===e.length)return e;var a=e;if("symbol"==typeof e?a=Symbol.prototype.toString.call(e):"string"!=typeof e&&(a=String(e)),"iso-8859-1"===t)return escape(a).replace(/%u[0-9a-f]{4}/gi,function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"});for(var i="",c=0;c<a.length;c+=limit){for(var l=a.length>=limit?a.slice(c,c+limit):a,f=[],s=0;s<l.length;++s){var u=l.charCodeAt(s);45===u||46===u||95===u||126===u||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||o===formats.RFC1738&&(40===u||41===u)?f[f.length]=l.charAt(s):u<128?f[f.length]=hexTable[u]:u<2048?f[f.length]=hexTable[192|u>>6]+hexTable[128|63&u]:u<55296||u>=57344?f[f.length]=hexTable[224|u>>12]+hexTable[128|u>>6&63]+hexTable[128|63&u]:(s+=1,u=65536+((1023&u)<<10|1023&l.charCodeAt(s)),f[f.length]=hexTable[240|u>>18]+hexTable[128|u>>12&63]+hexTable[128|u>>6&63]+hexTable[128|63&u])}i+=f.join("")}return i},compact=function compact(e){for(var r=[{obj:{o:e},prop:"o"}],t=[],n=0;n<r.length;++n)for(var o=r[n],a=o.obj[o.prop],i=Object.keys(a),c=0;c<i.length;++c){var l=i[c],f=a[l];"object"==typeof f&&null!==f&&-1===t.indexOf(f)&&(r[r.length]={obj:a,prop:l},t[t.length]=f)}return compactQueue(r),e},isRegExp=function isRegExp(e){return"[object RegExp]"===Object.prototype.toString.call(e)},isBuffer=function isBuffer(e){return!(!e||"object"!=typeof e||!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e)))},combine=function combine(e,r,t,n){if(isOverflow(e)){var o=getMaxIndex(e)+1;return e[o]=r,setMaxIndex(e,o),e}var a=[].concat(e,r);return a.length>t?markOverflow(arrayToObject(a,{plainObjects:n}),a.length-1):a},maybeMap=function maybeMap(e,r){if(isArray(e)){for(var t=[],n=0;n<e.length;n+=1)t[t.length]=r(e[n]);return t}return r(e)};module.exports={/* common-shake removed: arrayToObject:arrayToObject *//* common-shake removed: assign:assign */combine:combine,compact:compact,decode:decode,encode:encode,isBuffer:isBuffer,isOverflow:isOverflow,isRegExp:isRegExp,markOverflow:markOverflow,maybeMap:maybeMap,merge:merge};
15
15
 
16
16
  },{"1":1,"46":46}],46:[function(require,module,exports){
17
17
  "use strict";var $TypeError=require(20),inspect=require(42),getSideChannelList=require(43),getSideChannelMap=require(44),getSideChannelWeakMap=require(45),makeChannel=getSideChannelWeakMap||getSideChannelMap||getSideChannelList;module.exports=function getSideChannel(){var e,n={assert:function(e){if(!n.has(e))throw new $TypeError("Side channel does not contain "+inspect(e))},delete:function(n){return!!e&&e.delete(n)},get:function(n){return e&&e.get(n)},has:function(n){return!!e&&e.has(n)},set:function(n,t){e||(e=makeChannel()),e.set(n,t)}};return n};
@@ -21,12 +21,12 @@
21
21
  },{}],7:[function(require,module,exports){
22
22
  "use strict";var bind=require(24),$apply=require(8),$call=require(9),$reflectApply=require(11);module.exports=$reflectApply||bind.call($call,$apply);
23
23
 
24
- },{"11":11,"24":24,"8":8,"9":9}],9:[function(require,module,exports){
25
- "use strict";module.exports=Function.prototype.call;
26
-
27
- },{}],8:[function(require,module,exports){
24
+ },{"11":11,"24":24,"8":8,"9":9}],8:[function(require,module,exports){
28
25
  "use strict";module.exports=Function.prototype.apply;
29
26
 
27
+ },{}],9:[function(require,module,exports){
28
+ "use strict";module.exports=Function.prototype.call;
29
+
30
30
  },{}],24:[function(require,module,exports){
31
31
  "use strict";var implementation=require(23);module.exports=Function.prototype.bind||implementation;
32
32
 
@@ -78,24 +78,24 @@
78
78
  },{}],23:[function(require,module,exports){
79
79
  "use strict";var ERROR_MESSAGE="Function.prototype.bind called on incompatible ",toStr=Object.prototype.toString,max=Math.max,funcType="[object Function]",concatty=function concatty(t,n){for(var r=[],o=0;o<t.length;o+=1)r[o]=t[o];for(var e=0;e<n.length;e+=1)r[e+t.length]=n[e];return r},slicy=function slicy(t,n){for(var r=[],o=n||0,e=0;o<t.length;o+=1,e+=1)r[e]=t[o];return r},joiny=function(t,n){for(var r="",o=0;o<t.length;o+=1)r+=t[o],o+1<t.length&&(r+=n);return r};module.exports=function bind(t){var n=this;if("function"!=typeof n||toStr.apply(n)!==funcType)throw new TypeError(ERROR_MESSAGE+n);for(var r,o=slicy(arguments,1),e=max(0,n.length-o.length),i=[],c=0;c<e;c++)i[c]="$"+c;if(r=Function("binder","return function ("+joiny(i,",")+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof r){var e=n.apply(this,concatty(o,arguments));return Object(e)===e?e:this}return n.apply(t,concatty(o,arguments))}),n.prototype){var p=function Empty(){};p.prototype=n.prototype,r.prototype=new p,p.prototype=null}return r};
80
80
 
81
- },{}],39:[function(require,module,exports){
82
- "use strict";module.exports=Math.pow;
83
-
84
- },{}],37:[function(require,module,exports){
85
- "use strict";module.exports=Math.max;
81
+ },{}],35:[function(require,module,exports){
82
+ "use strict";module.exports=Math.floor;
86
83
 
87
84
  },{}],34:[function(require,module,exports){
88
85
  "use strict";module.exports=Math.abs;
89
86
 
87
+ },{}],39:[function(require,module,exports){
88
+ "use strict";module.exports=Math.pow;
89
+
90
90
  },{}],38:[function(require,module,exports){
91
91
  "use strict";module.exports=Math.min;
92
92
 
93
- },{}],35:[function(require,module,exports){
94
- "use strict";module.exports=Math.floor;
95
-
96
93
  },{}],40:[function(require,module,exports){
97
94
  "use strict";module.exports=Math.round;
98
95
 
96
+ },{}],37:[function(require,module,exports){
97
+ "use strict";module.exports=Math.max;
98
+
99
99
  },{}],27:[function(require,module,exports){
100
100
  "use strict";module.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null;
101
101
 
@@ -105,13 +105,13 @@
105
105
  },{"22":22}],41:[function(require,module,exports){
106
106
  "use strict";var $isNaN=require(36);module.exports=function sign(i){return $isNaN(i)||0===i?i:i<0?-1:1};
107
107
 
108
- },{"36":36}],33:[function(require,module,exports){
109
- "use strict";var call=Function.prototype.call,$hasOwn=Object.prototype.hasOwnProperty,bind=require(24);module.exports=bind.call(call,$hasOwn);
110
-
111
- },{"24":24}],31:[function(require,module,exports){
108
+ },{"36":36}],31:[function(require,module,exports){
112
109
  "use strict";var origSymbol="undefined"!=typeof Symbol&&Symbol,hasSymbolSham=require(32);module.exports=function hasNativeSymbols(){return"function"==typeof origSymbol&&"function"==typeof Symbol&&"symbol"==typeof origSymbol("foo")&&"symbol"==typeof Symbol("bar")&&hasSymbolSham()};
113
110
 
114
- },{"32":32}],28:[function(require,module,exports){
111
+ },{"32":32}],33:[function(require,module,exports){
112
+ "use strict";var call=Function.prototype.call,$hasOwn=Object.prototype.hasOwnProperty,bind=require(24);module.exports=bind.call(call,$hasOwn);
113
+
114
+ },{"24":24}],28:[function(require,module,exports){
115
115
  "use strict";var reflectGetProto=require(27),originalGetProto=require(26),getDunderProto=require(13);module.exports=reflectGetProto?function getProto(t){return reflectGetProto(t)}:originalGetProto?function getProto(t){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("getProto: not an object");return originalGetProto(t)}:getDunderProto?function getProto(t){return getDunderProto(t)}:null;
116
116
 
117
117
  },{"13":13,"26":26,"27":27}],29:[function(require,module,exports){
@@ -25,6 +25,7 @@ var defaults = {
25
25
  parseArrays: true,
26
26
  plainObjects: false,
27
27
  strictDepth: false,
28
+ strictMerge: true,
28
29
  strictNullHandling: false,
29
30
  throwOnLimitExceeded: false
30
31
  };
@@ -139,7 +140,7 @@ var parseValues = function parseQueryStringValues(str, options) {
139
140
 
140
141
  if (key !== null) {
141
142
  var existing = has.call(obj, key);
142
- if (existing && options.duplicates === 'combine') {
143
+ if (existing && (options.duplicates === 'combine' || part.indexOf('[]=') > -1)) {
143
144
  obj[key] = utils.combine(
144
145
  obj[key],
145
146
  val,
@@ -339,6 +340,7 @@ var normalizeParseOptions = function normalizeParseOptions(opts) {
339
340
  parseArrays: opts.parseArrays !== false,
340
341
  plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
341
342
  strictDepth: typeof opts.strictDepth === 'boolean' ? !!opts.strictDepth : defaults.strictDepth,
343
+ strictMerge: typeof opts.strictMerge === 'boolean' ? !!opts.strictMerge : defaults.strictMerge,
342
344
  strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling,
343
345
  throwOnLimitExceeded: typeof opts.throwOnLimitExceeded === 'boolean' ? opts.throwOnLimitExceeded : false
344
346
  };
@@ -85,6 +85,8 @@ var merge = function merge(target, source, options) {
85
85
  var newIndex = getMaxIndex(target) + 1;
86
86
  target[newIndex] = source;
87
87
  setMaxIndex(target, newIndex);
88
+ } else if (options && options.strictMerge) {
89
+ return [target, source];
88
90
  } else if (
89
91
  (options && (options.plainObjects || options.allowPrototypes))
90
92
  || !has.call(Object.prototype, source)
@@ -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.14.2",
5
+ "version": "6.15.0",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/ljharb/qs.git"
@@ -784,25 +784,25 @@ test('parse()', function (t) {
784
784
 
785
785
  t.test('add keys to objects', function (st) {
786
786
  st.deepEqual(
787
- qs.parse('a[b]=c&a=d'),
787
+ qs.parse('a[b]=c&a=d', { strictMerge: false }),
788
788
  { a: { b: 'c', d: true } },
789
789
  'can add keys to objects'
790
790
  );
791
791
 
792
792
  st.deepEqual(
793
- qs.parse('a[b]=c&a=toString'),
793
+ qs.parse('a[b]=c&a=toString', { strictMerge: false }),
794
794
  { a: { b: 'c' } },
795
795
  'can not overwrite prototype'
796
796
  );
797
797
 
798
798
  st.deepEqual(
799
- qs.parse('a[b]=c&a=toString', { allowPrototypes: true }),
799
+ qs.parse('a[b]=c&a=toString', { strictMerge: false, allowPrototypes: true }),
800
800
  { a: { b: 'c', toString: true } },
801
801
  'can overwrite prototype with allowPrototypes true'
802
802
  );
803
803
 
804
804
  st.deepEqual(
805
- qs.parse('a[b]=c&a=toString', { plainObjects: true }),
805
+ qs.parse('a[b]=c&a=toString', { strictMerge: false, plainObjects: true }),
806
806
  { __proto__: null, a: { __proto__: null, b: 'c', toString: true } },
807
807
  'can overwrite prototype with plainObjects true'
808
808
  );
@@ -810,6 +810,34 @@ test('parse()', function (t) {
810
810
  st.end();
811
811
  });
812
812
 
813
+ t.test('strictMerge wraps object and primitive into an array', function (st) {
814
+ st.deepEqual(
815
+ qs.parse('a[b]=c&a=d'),
816
+ { a: [{ b: 'c' }, 'd'] },
817
+ 'object then primitive produces array'
818
+ );
819
+
820
+ st.deepEqual(
821
+ qs.parse('a=d&a[b]=c'),
822
+ { a: ['d', { b: 'c' }] },
823
+ 'primitive then object produces array'
824
+ );
825
+
826
+ st.deepEqual(
827
+ qs.parse('a[b]=c&a=toString'),
828
+ { a: [{ b: 'c' }, 'toString'] },
829
+ 'prototype-colliding value is preserved in array'
830
+ );
831
+
832
+ st.deepEqual(
833
+ qs.parse('a[b]=c&a=toString', { plainObjects: true }),
834
+ { __proto__: null, a: [{ __proto__: null, b: 'c' }, 'toString'] },
835
+ 'plainObjects preserved in array wrapping'
836
+ );
837
+
838
+ st.end();
839
+ });
840
+
813
841
  t.test('dunder proto is ignored', function (st) {
814
842
  var payload = 'categories[__proto__]=login&categories[__proto__]&categories[length]=42';
815
843
  var result = qs.parse(payload, { allowPrototypes: true });
@@ -1229,6 +1257,34 @@ test('`duplicates` option', function (t) {
1229
1257
  'duplicates: last'
1230
1258
  );
1231
1259
 
1260
+ t.test('bracket notation always combines regardless of duplicates', function (st) {
1261
+ st.deepEqual(
1262
+ qs.parse('a=1&a=2&b[]=1&b[]=2', { duplicates: 'last' }),
1263
+ { a: '2', b: ['1', '2'] },
1264
+ 'duplicates last: unbracketed takes last, bracketed combines'
1265
+ );
1266
+
1267
+ st.deepEqual(
1268
+ qs.parse('b[]=1&b[]=2', { duplicates: 'last' }),
1269
+ { b: ['1', '2'] },
1270
+ 'duplicates last: bracketed always combines'
1271
+ );
1272
+
1273
+ st.deepEqual(
1274
+ qs.parse('b[]=1&b[]=2', { duplicates: 'first' }),
1275
+ { b: ['1', '2'] },
1276
+ 'duplicates first: bracketed always combines'
1277
+ );
1278
+
1279
+ st.deepEqual(
1280
+ qs.parse('a=1&a=2&b[]=1&b[]=2', { duplicates: 'first' }),
1281
+ { a: '1', b: ['1', '2'] },
1282
+ 'duplicates first: unbracketed takes first, bracketed combines'
1283
+ );
1284
+
1285
+ st.end();
1286
+ });
1287
+
1232
1288
  t.end();
1233
1289
  });
1234
1290
 
@@ -95,6 +95,13 @@ test('merge()', function (t) {
95
95
  s2t.end();
96
96
  });
97
97
 
98
+ st.test('with strictMerge, wraps object and primitive in array', function (s2t) {
99
+ var obj = { foo: 'bar' };
100
+ var merged = utils.merge(obj, 'baz', { strictMerge: true });
101
+ s2t.deepEqual(merged, [{ foo: 'bar' }, 'baz'], 'wraps in array with strictMerge');
102
+ s2t.end();
103
+ });
104
+
98
105
  st.test('merges overflow object into primitive', function (s2t) {
99
106
  // Create an overflow object via combine: 2 elements (indices 0-1) with limit 0
100
107
  var overflow = utils.combine(['a'], 'b', 0, false);
package/package.json CHANGED
@@ -87,7 +87,7 @@
87
87
  "publishConfig": {
88
88
  "access": "public"
89
89
  },
90
- "version": "2.0.1399",
90
+ "version": "2.0.1400",
91
91
  "jest": {
92
92
  "coverageProvider": "v8",
93
93
  "testMatch": [