query-string 2.4.2 → 3.0.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.
Files changed (3) hide show
  1. package/index.js +9 -1
  2. package/package.json +1 -1
  3. package/readme.md +1 -1
package/index.js CHANGED
@@ -45,8 +45,16 @@ exports.stringify = function (obj) {
45
45
  return obj ? Object.keys(obj).sort().map(function (key) {
46
46
  var val = obj[key];
47
47
 
48
+ if (val === undefined) {
49
+ return '';
50
+ }
51
+
52
+ if (val === null) {
53
+ return key;
54
+ }
55
+
48
56
  if (Array.isArray(val)) {
49
- return val.sort().map(function (val2) {
57
+ return val.slice().sort().map(function (val2) {
50
58
  return strictUriEncode(key) + '=' + strictUriEncode(val2);
51
59
  }).join('&');
52
60
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "query-string",
3
- "version": "2.4.2",
3
+ "version": "3.0.3",
4
4
  "description": "Parse and stringify URL query strings",
5
5
  "license": "MIT",
6
6
  "repository": "sindresorhus/query-string",
package/readme.md CHANGED
@@ -73,4 +73,4 @@ queryString.stringify({
73
73
 
74
74
  ## License
75
75
 
76
- MIT © [Sindre Sorhus](http://sindresorhus.com)
76
+ MIT © [Sindre Sorhus](https://sindresorhus.com)