qs 2.2.3 → 2.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- ## [**2.2.3**](https://github.com/hapijs/qs/issues?milestone=12&state=open)
2
+ ## [**2.2.3**](https://github.com/hapijs/qs/issues?milestone=12&state=closed)
3
3
  - [**#37**](https://github.com/hapijs/qs/issues/37) parser discards first empty value in array
4
4
  - [**#36**](https://github.com/hapijs/qs/issues/36) Update to lab 4.x
5
5
 
@@ -8,45 +8,22 @@
8
8
  - [**#34**](https://github.com/hapijs/qs/issues/34) use Object.prototype.hasOwnProperty.call instead of obj.hasOwnProperty
9
9
  - [**#24**](https://github.com/hapijs/qs/issues/24) Changelog? Semver?
10
10
 
11
- ---
12
-
13
-
14
-
15
- ## [**2.2.2**](https://github.com/hapijs/qs/issues?milestone=11&state=closed)
16
- - [**#33**](https://github.com/hapijs/qs/issues/33) Error when plain object in a value
17
- - [**#34**](https://github.com/hapijs/qs/issues/34) use Object.prototype.hasOwnProperty.call instead of obj.hasOwnProperty
18
- - [**#24**](https://github.com/hapijs/qs/issues/24) Changelog? Semver?
19
-
20
- ---
21
-
22
-
23
-
24
- ## [**2.2.2**](https://github.com/hapijs/qs/issues?milestone=11&state=open)
25
- - [**#34**](https://github.com/hapijs/qs/issues/34) use Object.prototype.hasOwnProperty.call instead of obj.hasOwnProperty
26
- - [**#24**](https://github.com/hapijs/qs/issues/24) Changelog? Semver?
27
-
28
- ---
29
-
30
-
31
- # 2014-08-28
32
- 95 commits against 24 issues, over a month [`32edf33`](https://github.com/hapijs/qs/commit/32edf33)⎆[`b1e7b53`](https://github.com/hapijs/qs/commit/b1e7b53)
33
-
34
11
  ## [**2.2.1**](https://github.com/hapijs/qs/issues?milestone=10&state=closed)
35
12
  - [**#32**](https://github.com/hapijs/qs/issues/32) account for circular references properly, closes #31
36
13
  - [**#31**](https://github.com/hapijs/qs/issues/31) qs.parse stackoverflow on circular objects
37
14
 
38
15
  ## [**2.2.0**](https://github.com/hapijs/qs/issues?milestone=9&state=closed)
16
+ - [**#26**](https://github.com/hapijs/qs/issues/26) Don't use Buffer global if it's not present
39
17
  - [**#30**](https://github.com/hapijs/qs/issues/30) Bug when merging non-object values into arrays
40
18
  - [**#29**](https://github.com/hapijs/qs/issues/29) Don't call Utils.clone at the top of Utils.merge
41
- - [**#26**](https://github.com/hapijs/qs/issues/26) Don't use Buffer global if it's not present
42
19
  - [**#23**](https://github.com/hapijs/qs/issues/23) Ability to not limit parameters?
43
20
 
44
21
  ## [**2.1.0**](https://github.com/hapijs/qs/issues?milestone=8&state=closed)
45
22
  - [**#22**](https://github.com/hapijs/qs/issues/22) Enable using a RegExp as delimiter
46
23
 
47
24
  ## [**2.0.0**](https://github.com/hapijs/qs/issues?milestone=7&state=closed)
48
- - [**#20**](https://github.com/hapijs/qs/issues/20) Configurable parametersLimit
49
25
  - [**#18**](https://github.com/hapijs/qs/issues/18) Why is there arrayLimit?
26
+ - [**#20**](https://github.com/hapijs/qs/issues/20) Configurable parametersLimit
50
27
  - [**#21**](https://github.com/hapijs/qs/issues/21) make all limits optional, for #18, for #20
51
28
 
52
29
  ## [**1.2.2**](https://github.com/hapijs/qs/issues?milestone=6&state=closed)
@@ -68,11 +45,3 @@
68
45
  ## [**1.0.2**](https://github.com/hapijs/qs/issues?milestone=2&state=closed)
69
46
  - [**#5**](https://github.com/hapijs/qs/issues/5) array holes incorrectly copied into object on large index
70
47
 
71
-
72
- ## Issues
73
- - [**#25**](https://github.com/hapijs/qs/issues/25) Remove references to Buffer
74
- - [**#11**](https://github.com/hapijs/qs/issues/11) Flattened keys in array does not parse correctly
75
- - [**#8**](https://github.com/hapijs/qs/issues/8) Square brackets should be URI encoded
76
- - [**#3**](https://github.com/hapijs/qs/issues/3) Update README.md
77
- - [**#2**](https://github.com/hapijs/qs/issues/2) Add travis and rework package
78
-
package/lib/parse.js CHANGED
@@ -58,8 +58,10 @@ internals.parseObject = function (chain, val, options) {
58
58
  else {
59
59
  var cleanRoot = root[0] === '[' && root[root.length - 1] === ']' ? root.slice(1, root.length - 1) : root;
60
60
  var index = parseInt(cleanRoot, 10);
61
+ var indexString = '' + index;
61
62
  if (!isNaN(index) &&
62
63
  root !== cleanRoot &&
64
+ indexString === cleanRoot &&
63
65
  index <= options.arrayLimit) {
64
66
 
65
67
  obj = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qs",
3
- "version": "2.2.3",
3
+ "version": "2.2.4",
4
4
  "description": "A querystring parser that supports nesting and arrays, with a depth limit",
5
5
  "homepage": "https://github.com/hapijs/qs",
6
6
  "main": "index.js",
package/test/parse.js CHANGED
@@ -104,6 +104,12 @@ describe('#parse', function () {
104
104
  done();
105
105
  });
106
106
 
107
+ it('supports keys that begin with a number', function (done) {
108
+
109
+ expect(Qs.parse('a[12b]=c')).to.deep.equal({ a: { '12b': 'c' } });
110
+ done();
111
+ });
112
+
107
113
  it('supports encoded = signs', function (done) {
108
114
 
109
115
  expect(Qs.parse('he%3Dllo=th%3Dere')).to.deep.equal({ 'he=llo': 'th=ere' });