qs 2.2.2 → 2.2.3

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,4 +1,26 @@
1
1
 
2
+ ## [**2.2.3**](https://github.com/hapijs/qs/issues?milestone=12&state=open)
3
+ - [**#37**](https://github.com/hapijs/qs/issues/37) parser discards first empty value in array
4
+ - [**#36**](https://github.com/hapijs/qs/issues/36) Update to lab 4.x
5
+
6
+ ## [**2.2.2**](https://github.com/hapijs/qs/issues?milestone=11&state=closed)
7
+ - [**#33**](https://github.com/hapijs/qs/issues/33) Error when plain object in a value
8
+ - [**#34**](https://github.com/hapijs/qs/issues/34) use Object.prototype.hasOwnProperty.call instead of obj.hasOwnProperty
9
+ - [**#24**](https://github.com/hapijs/qs/issues/24) Changelog? Semver?
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
+
2
24
  ## [**2.2.2**](https://github.com/hapijs/qs/issues?milestone=11&state=open)
3
25
  - [**#34**](https://github.com/hapijs/qs/issues/34) use Object.prototype.hasOwnProperty.call instead of obj.hasOwnProperty
4
26
  - [**#24**](https://github.com/hapijs/qs/issues/24) Changelog? Semver?
package/lib/parse.js CHANGED
@@ -29,7 +29,7 @@ internals.parseValues = function (str, options) {
29
29
  var key = Utils.decode(part.slice(0, pos));
30
30
  var val = Utils.decode(part.slice(pos + 1));
31
31
 
32
- if (!obj[key]) {
32
+ if (!obj.hasOwnProperty(key)) {
33
33
  obj[key] = val;
34
34
  }
35
35
  else {
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "qs",
3
- "version": "2.2.2",
3
+ "version": "2.2.3",
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",
7
7
  "dependencies": {},
8
8
  "devDependencies": {
9
- "lab": "3.x.x"
9
+ "lab": "4.x.x"
10
10
  },
11
11
  "scripts": {
12
12
  "test": "make test-cov"
package/test/parse.js CHANGED
@@ -11,11 +11,12 @@ var internals = {};
11
11
 
12
12
  // Test shortcuts
13
13
 
14
+ var lab = exports.lab = Lab.script();
14
15
  var expect = Lab.expect;
15
- var before = Lab.before;
16
- var after = Lab.after;
17
- var describe = Lab.experiment;
18
- var it = Lab.test;
16
+ var before = lab.before;
17
+ var after = lab.after;
18
+ var describe = lab.experiment;
19
+ var it = lab.test;
19
20
 
20
21
 
21
22
  describe('#parse', function () {
@@ -189,6 +190,7 @@ describe('#parse', function () {
189
190
 
190
191
  expect(Qs.parse('a[]=b&a[]=&a[]=c')).to.deep.equal({ a: ['b', '', 'c'] });
191
192
  expect(Qs.parse('a[0]=b&a[1]=&a[2]=c&a[19]=')).to.deep.equal({ a: ['b', '', 'c', ''] });
193
+ expect(Qs.parse('a[]=&a[]=b&a[]=c')).to.deep.equal({ a: ['', 'b', 'c'] });
192
194
  done();
193
195
  });
194
196
 
package/test/stringify.js CHANGED
@@ -11,11 +11,12 @@ var internals = {};
11
11
 
12
12
  // Test shortcuts
13
13
 
14
+ var lab = exports.lab = Lab.script();
14
15
  var expect = Lab.expect;
15
- var before = Lab.before;
16
- var after = Lab.after;
17
- var describe = Lab.experiment;
18
- var it = Lab.test;
16
+ var before = lab.before;
17
+ var after = lab.after;
18
+ var describe = lab.experiment;
19
+ var it = lab.test;
19
20
 
20
21
 
21
22
  describe('#stringify', function () {