fsevents 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of fsevents might be problematic. Click here for more details.

Files changed (149) hide show
  1. package/node_modules/node-pre-gyp/CHANGELOG.md +9 -0
  2. package/node_modules/node-pre-gyp/lib/util/abi_crosswalk.json +32 -0
  3. package/node_modules/node-pre-gyp/node_modules/mkdirp/node_modules/minimist/package.json +2 -1
  4. package/node_modules/node-pre-gyp/node_modules/nopt/README.md +8 -7
  5. package/node_modules/node-pre-gyp/node_modules/nopt/package.json +16 -12
  6. package/node_modules/node-pre-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/core-util-is/package.json +1 -1
  7. package/node_modules/node-pre-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/node_modules/inherits/package.json +1 -1
  8. package/node_modules/node-pre-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/readable-stream/package.json +1 -1
  9. package/node_modules/node-pre-gyp/node_modules/rc/lib/utils.js +2 -2
  10. package/node_modules/node-pre-gyp/node_modules/rc/node_modules/minimist/index.js +14 -2
  11. package/node_modules/node-pre-gyp/node_modules/rc/node_modules/minimist/package.json +10 -9
  12. package/node_modules/node-pre-gyp/node_modules/rc/node_modules/minimist/test/bool.js +23 -0
  13. package/node_modules/node-pre-gyp/node_modules/rc/node_modules/minimist/test/kv_short.js +16 -0
  14. package/node_modules/node-pre-gyp/node_modules/rc/package.json +9 -8
  15. package/node_modules/node-pre-gyp/node_modules/request/.travis.yml +1 -0
  16. package/node_modules/node-pre-gyp/node_modules/request/CHANGELOG.md +22 -2
  17. package/node_modules/node-pre-gyp/node_modules/request/README.md +42 -10
  18. package/node_modules/node-pre-gyp/node_modules/request/index.js +4 -0
  19. package/node_modules/node-pre-gyp/node_modules/request/node_modules/aws-sign2/package.json +1 -1
  20. package/node_modules/node-pre-gyp/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json +1 -1
  21. package/node_modules/node-pre-gyp/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/inherits/package.json +1 -1
  22. package/node_modules/node-pre-gyp/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/index.js +1 -1
  23. package/node_modules/node-pre-gyp/node_modules/request/node_modules/{form-data/node_modules/async/LICENSE → bl/node_modules/readable-stream/node_modules/process-nextick-args/license.md} +6 -6
  24. package/node_modules/node-pre-gyp/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/package.json +10 -9
  25. package/node_modules/node-pre-gyp/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/test.js +7 -0
  26. package/node_modules/node-pre-gyp/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json +2 -1
  27. package/node_modules/node-pre-gyp/node_modules/request/node_modules/bl/package.json +2 -1
  28. package/node_modules/node-pre-gyp/node_modules/request/node_modules/caseless/package.json +2 -1
  29. package/node_modules/node-pre-gyp/node_modules/request/node_modules/extend/package.json +2 -1
  30. package/node_modules/node-pre-gyp/node_modules/request/node_modules/forever-agent/package.json +1 -1
  31. package/node_modules/node-pre-gyp/node_modules/request/node_modules/form-data/Readme.md +44 -9
  32. package/node_modules/node-pre-gyp/node_modules/request/node_modules/form-data/lib/form_data.js +48 -25
  33. package/node_modules/node-pre-gyp/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js +13 -7
  34. package/node_modules/node-pre-gyp/node_modules/request/node_modules/form-data/node_modules/async/package.json +26 -11
  35. package/node_modules/node-pre-gyp/node_modules/request/node_modules/form-data/package.json +29 -20
  36. package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/bluebird/README.md +4 -1
  37. package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/browser/bluebird.js +35 -11
  38. package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/browser/bluebird.min.js +5 -5
  39. package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/debuggability.js +2 -0
  40. package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/direct_resolve.js +2 -0
  41. package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/promise.js +5 -1
  42. package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/promisify.js +10 -5
  43. package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/bluebird/js/main/using.js +14 -3
  44. package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/bluebird/package.json +9 -8
  45. package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/chalk/index.js +2 -2
  46. package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json +1 -1
  47. package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json +22 -15
  48. package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/chalk/readme.md +3 -2
  49. package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/commander/package.json +1 -1
  50. package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/README.md +1 -1
  51. package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/package.json +1 -1
  52. package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/package.json +1 -1
  53. package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/.travis.yml +6 -2
  54. package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/README.md +3 -2
  55. package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/jsonpointer.js +7 -10
  56. package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/package.json +24 -20
  57. package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/test.js +11 -13
  58. package/node_modules/node-pre-gyp/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/package.json +11 -10
  59. package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/boom/.travis.yml +3 -2
  60. package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js +39 -28
  61. package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/boom/package.json +11 -12
  62. package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/boom/test/index.js +1 -1
  63. package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/cryptiles/.npmignore +18 -18
  64. package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/cryptiles/.travis.yml +8 -5
  65. package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/cryptiles/README.md +2 -0
  66. package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json +24 -28
  67. package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/cryptiles/test/index.js +57 -63
  68. package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/hoek/.travis.yml +2 -2
  69. package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/hoek/LICENSE +0 -0
  70. package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/hoek/README.md +16 -6
  71. package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/hoek/images/hoek.png +0 -0
  72. package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/hoek/lib/escape.js +0 -0
  73. package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/hoek/lib/index.js +24 -8
  74. package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/hoek/package.json +13 -13
  75. package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/hoek/test/escaper.js +0 -0
  76. package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/hoek/test/index.js +866 -778
  77. package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test1.js +0 -0
  78. package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test2.js +0 -0
  79. package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/hoek/test/modules/test3.js +0 -0
  80. package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/sntp/package.json +1 -1
  81. package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/package.json +2 -1
  82. package/node_modules/node-pre-gyp/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json +1 -1
  83. package/node_modules/node-pre-gyp/node_modules/request/node_modules/http-signature/node_modules/ctype/package.json +1 -1
  84. package/node_modules/node-pre-gyp/node_modules/request/node_modules/isstream/package.json +1 -1
  85. package/node_modules/node-pre-gyp/node_modules/request/node_modules/mime-types/HISTORY.md +24 -0
  86. package/node_modules/node-pre-gyp/node_modules/request/node_modules/mime-types/index.js +1 -1
  87. package/node_modules/node-pre-gyp/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md +33 -0
  88. package/node_modules/node-pre-gyp/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json +50 -0
  89. package/node_modules/node-pre-gyp/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json +12 -13
  90. package/node_modules/node-pre-gyp/node_modules/request/node_modules/mime-types/package.json +9 -10
  91. package/node_modules/node-pre-gyp/node_modules/request/node_modules/node-uuid/package.json +1 -1
  92. package/node_modules/node-pre-gyp/node_modules/request/node_modules/qs/.npmignore +0 -1
  93. package/node_modules/node-pre-gyp/node_modules/request/node_modules/qs/.travis.yml +3 -2
  94. package/node_modules/node-pre-gyp/node_modules/request/node_modules/qs/CHANGELOG.md +13 -2
  95. package/node_modules/node-pre-gyp/node_modules/request/node_modules/qs/README.md +11 -4
  96. package/node_modules/node-pre-gyp/node_modules/request/node_modules/qs/bower.json +1 -1
  97. package/node_modules/node-pre-gyp/node_modules/request/node_modules/qs/component.json +15 -0
  98. package/node_modules/node-pre-gyp/node_modules/request/node_modules/qs/dist/qs.js +523 -0
  99. package/node_modules/node-pre-gyp/node_modules/request/node_modules/qs/lib/parse.js +3 -2
  100. package/node_modules/node-pre-gyp/node_modules/request/node_modules/qs/lib/stringify.js +28 -7
  101. package/node_modules/node-pre-gyp/node_modules/request/node_modules/qs/package.json +20 -18
  102. package/node_modules/node-pre-gyp/node_modules/request/node_modules/qs/test/parse.js +14 -14
  103. package/node_modules/node-pre-gyp/node_modules/request/node_modules/qs/test/stringify.js +23 -1
  104. package/node_modules/node-pre-gyp/node_modules/request/node_modules/stringstream/package.json +1 -1
  105. package/node_modules/node-pre-gyp/node_modules/request/package.json +12 -12
  106. package/node_modules/node-pre-gyp/node_modules/request/request.js +51 -30
  107. package/node_modules/node-pre-gyp/node_modules/rimraf/node_modules/glob/node_modules/inherits/package.json +1 -1
  108. package/node_modules/node-pre-gyp/node_modules/rimraf/node_modules/glob/node_modules/minimatch/package.json +3 -2
  109. package/node_modules/node-pre-gyp/node_modules/rimraf/node_modules/glob/package.json +2 -1
  110. package/node_modules/node-pre-gyp/node_modules/rimraf/package.json +9 -8
  111. package/node_modules/node-pre-gyp/node_modules/rimraf/rimraf.js +1 -1
  112. package/node_modules/node-pre-gyp/node_modules/semver/package.json +10 -12
  113. package/node_modules/node-pre-gyp/node_modules/semver/semver.js +1 -0
  114. package/node_modules/node-pre-gyp/node_modules/semver/test/index.js +21 -8
  115. package/node_modules/node-pre-gyp/node_modules/tar/lib/entry.js +7 -0
  116. package/node_modules/node-pre-gyp/node_modules/tar/lib/parse.js +5 -1
  117. package/node_modules/node-pre-gyp/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/fs.js +21 -11
  118. package/node_modules/node-pre-gyp/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/graceful-fs.js +208 -115
  119. package/node_modules/node-pre-gyp/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/legacy-streams.js +118 -0
  120. package/node_modules/node-pre-gyp/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/package.json +18 -17
  121. package/node_modules/node-pre-gyp/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/polyfills.js +130 -133
  122. package/node_modules/node-pre-gyp/node_modules/tar/node_modules/fstream/package.json +18 -14
  123. package/node_modules/node-pre-gyp/node_modules/tar/node_modules/inherits/package.json +1 -1
  124. package/node_modules/node-pre-gyp/node_modules/tar/package.json +22 -15
  125. package/node_modules/node-pre-gyp/node_modules/tar/test/parse-discard.js +29 -0
  126. package/node_modules/node-pre-gyp/node_modules/tar-pack/node_modules/fstream-ignore/node_modules/inherits/package.json +1 -1
  127. package/node_modules/node-pre-gyp/node_modules/tar-pack/node_modules/fstream-ignore/node_modules/minimatch/node_modules/lru-cache/README.md +12 -2
  128. package/node_modules/node-pre-gyp/node_modules/tar-pack/node_modules/fstream-ignore/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js +48 -4
  129. package/node_modules/node-pre-gyp/node_modules/tar-pack/node_modules/fstream-ignore/node_modules/minimatch/node_modules/lru-cache/package.json +9 -9
  130. package/node_modules/node-pre-gyp/node_modules/tar-pack/node_modules/fstream-ignore/node_modules/minimatch/node_modules/lru-cache/test/basic.js +26 -25
  131. package/node_modules/node-pre-gyp/node_modules/tar-pack/node_modules/fstream-ignore/node_modules/minimatch/node_modules/lru-cache/test/serialize.js +216 -0
  132. package/node_modules/node-pre-gyp/node_modules/tar-pack/node_modules/readable-stream/node_modules/core-util-is/package.json +1 -1
  133. package/node_modules/node-pre-gyp/node_modules/tar-pack/node_modules/readable-stream/package.json +1 -1
  134. package/node_modules/node-pre-gyp/package.json +10 -10
  135. package/package.json +2 -2
  136. package/node_modules/node-pre-gyp/node_modules/request/node_modules/form-data/node_modules/async/.jscsrc +0 -3
  137. package/node_modules/node-pre-gyp/node_modules/request/node_modules/form-data/node_modules/async/CHANGELOG.md +0 -81
  138. package/node_modules/node-pre-gyp/node_modules/request/node_modules/form-data/node_modules/async/README.md +0 -1789
  139. package/node_modules/node-pre-gyp/node_modules/request/node_modules/form-data/node_modules/async/support/sync-package-managers.js +0 -53
  140. package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/cryptiles/Makefile +0 -9
  141. package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/cryptiles/index.js +0 -1
  142. package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/hoek/Makefile +0 -8
  143. package/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/hoek/index.js +0 -1
  144. package/node_modules/node-pre-gyp/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/.npmignore +0 -1
  145. package/node_modules/node-pre-gyp/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/LICENSE +0 -15
  146. package/node_modules/node-pre-gyp/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/test/max-open.js +0 -69
  147. package/node_modules/node-pre-gyp/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/test/open.js +0 -39
  148. package/node_modules/node-pre-gyp/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/test/readdir-sort.js +0 -20
  149. package/node_modules/node-pre-gyp/node_modules/tar/node_modules/fstream/node_modules/graceful-fs/test/write-then-read.js +0 -47
@@ -0,0 +1,523 @@
1
+ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Qs = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
2
+ // Load modules
3
+
4
+ var Stringify = require('./stringify');
5
+ var Parse = require('./parse');
6
+
7
+
8
+ // Declare internals
9
+
10
+ var internals = {};
11
+
12
+
13
+ module.exports = {
14
+ stringify: Stringify,
15
+ parse: Parse
16
+ };
17
+
18
+ },{"./parse":2,"./stringify":3}],2:[function(require,module,exports){
19
+ // Load modules
20
+
21
+ var Utils = require('./utils');
22
+
23
+
24
+ // Declare internals
25
+
26
+ var internals = {
27
+ delimiter: '&',
28
+ depth: 5,
29
+ arrayLimit: 20,
30
+ parameterLimit: 1000,
31
+ strictNullHandling: false,
32
+ plainObjects: false,
33
+ allowPrototypes: false,
34
+ allowDots: false
35
+ };
36
+
37
+
38
+ internals.parseValues = function (str, options) {
39
+
40
+ var obj = {};
41
+ var parts = str.split(options.delimiter, options.parameterLimit === Infinity ? undefined : options.parameterLimit);
42
+
43
+ for (var i = 0, il = parts.length; i < il; ++i) {
44
+ var part = parts[i];
45
+ var pos = part.indexOf(']=') === -1 ? part.indexOf('=') : part.indexOf(']=') + 1;
46
+
47
+ if (pos === -1) {
48
+ obj[Utils.decode(part)] = '';
49
+
50
+ if (options.strictNullHandling) {
51
+ obj[Utils.decode(part)] = null;
52
+ }
53
+ }
54
+ else {
55
+ var key = Utils.decode(part.slice(0, pos));
56
+ var val = Utils.decode(part.slice(pos + 1));
57
+
58
+ if (!Object.prototype.hasOwnProperty.call(obj, key)) {
59
+ obj[key] = val;
60
+ }
61
+ else {
62
+ obj[key] = [].concat(obj[key]).concat(val);
63
+ }
64
+ }
65
+ }
66
+
67
+ return obj;
68
+ };
69
+
70
+
71
+ internals.parseObject = function (chain, val, options) {
72
+
73
+ if (!chain.length) {
74
+ return val;
75
+ }
76
+
77
+ var root = chain.shift();
78
+
79
+ var obj;
80
+ if (root === '[]') {
81
+ obj = [];
82
+ obj = obj.concat(internals.parseObject(chain, val, options));
83
+ }
84
+ else {
85
+ obj = options.plainObjects ? Object.create(null) : {};
86
+ var cleanRoot = root[0] === '[' && root[root.length - 1] === ']' ? root.slice(1, root.length - 1) : root;
87
+ var index = parseInt(cleanRoot, 10);
88
+ var indexString = '' + index;
89
+ if (!isNaN(index) &&
90
+ root !== cleanRoot &&
91
+ indexString === cleanRoot &&
92
+ index >= 0 &&
93
+ (options.parseArrays &&
94
+ index <= options.arrayLimit)) {
95
+
96
+ obj = [];
97
+ obj[index] = internals.parseObject(chain, val, options);
98
+ }
99
+ else {
100
+ obj[cleanRoot] = internals.parseObject(chain, val, options);
101
+ }
102
+ }
103
+
104
+ return obj;
105
+ };
106
+
107
+
108
+ internals.parseKeys = function (key, val, options) {
109
+
110
+ if (!key) {
111
+ return;
112
+ }
113
+
114
+ // Transform dot notation to bracket notation
115
+
116
+ if (options.allowDots) {
117
+ key = key.replace(/\.([^\.\[]+)/g, '[$1]');
118
+ }
119
+
120
+ // The regex chunks
121
+
122
+ var parent = /^([^\[\]]*)/;
123
+ var child = /(\[[^\[\]]*\])/g;
124
+
125
+ // Get the parent
126
+
127
+ var segment = parent.exec(key);
128
+
129
+ // Stash the parent if it exists
130
+
131
+ var keys = [];
132
+ if (segment[1]) {
133
+ // If we aren't using plain objects, optionally prefix keys
134
+ // that would overwrite object prototype properties
135
+ if (!options.plainObjects &&
136
+ Object.prototype.hasOwnProperty(segment[1])) {
137
+
138
+ if (!options.allowPrototypes) {
139
+ return;
140
+ }
141
+ }
142
+
143
+ keys.push(segment[1]);
144
+ }
145
+
146
+ // Loop through children appending to the array until we hit depth
147
+
148
+ var i = 0;
149
+ while ((segment = child.exec(key)) !== null && i < options.depth) {
150
+
151
+ ++i;
152
+ if (!options.plainObjects &&
153
+ Object.prototype.hasOwnProperty(segment[1].replace(/\[|\]/g, ''))) {
154
+
155
+ if (!options.allowPrototypes) {
156
+ continue;
157
+ }
158
+ }
159
+ keys.push(segment[1]);
160
+ }
161
+
162
+ // If there's a remainder, just add whatever is left
163
+
164
+ if (segment) {
165
+ keys.push('[' + key.slice(segment.index) + ']');
166
+ }
167
+
168
+ return internals.parseObject(keys, val, options);
169
+ };
170
+
171
+
172
+ module.exports = function (str, options) {
173
+
174
+ options = options || {};
175
+ options.delimiter = typeof options.delimiter === 'string' || Utils.isRegExp(options.delimiter) ? options.delimiter : internals.delimiter;
176
+ options.depth = typeof options.depth === 'number' ? options.depth : internals.depth;
177
+ options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : internals.arrayLimit;
178
+ options.parseArrays = options.parseArrays !== false;
179
+ options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : internals.allowDots;
180
+ options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : internals.plainObjects;
181
+ options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : internals.allowPrototypes;
182
+ options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : internals.parameterLimit;
183
+ options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : internals.strictNullHandling;
184
+
185
+ if (str === '' ||
186
+ str === null ||
187
+ typeof str === 'undefined') {
188
+
189
+ return options.plainObjects ? Object.create(null) : {};
190
+ }
191
+
192
+ var tempObj = typeof str === 'string' ? internals.parseValues(str, options) : str;
193
+ var obj = options.plainObjects ? Object.create(null) : {};
194
+
195
+ // Iterate over the keys and setup the new object
196
+
197
+ var keys = Object.keys(tempObj);
198
+ for (var i = 0, il = keys.length; i < il; ++i) {
199
+ var key = keys[i];
200
+ var newObj = internals.parseKeys(key, tempObj[key], options);
201
+ obj = Utils.merge(obj, newObj, options);
202
+ }
203
+
204
+ return Utils.compact(obj);
205
+ };
206
+
207
+ },{"./utils":4}],3:[function(require,module,exports){
208
+ // Load modules
209
+
210
+ var Utils = require('./utils');
211
+
212
+
213
+ // Declare internals
214
+
215
+ var internals = {
216
+ delimiter: '&',
217
+ arrayPrefixGenerators: {
218
+ brackets: function (prefix, key) {
219
+
220
+ return prefix + '[]';
221
+ },
222
+ indices: function (prefix, key) {
223
+
224
+ return prefix + '[' + key + ']';
225
+ },
226
+ repeat: function (prefix, key) {
227
+
228
+ return prefix;
229
+ }
230
+ },
231
+ strictNullHandling: false
232
+ };
233
+
234
+
235
+ internals.stringify = function (obj, prefix, generateArrayPrefix, strictNullHandling, filter) {
236
+
237
+ if (typeof filter === 'function') {
238
+ obj = filter(prefix, obj);
239
+ }
240
+ else if (Utils.isBuffer(obj)) {
241
+ obj = obj.toString();
242
+ }
243
+ else if (obj instanceof Date) {
244
+ obj = obj.toISOString();
245
+ }
246
+ else if (obj === null) {
247
+ if (strictNullHandling) {
248
+ return Utils.encode(prefix);
249
+ }
250
+
251
+ obj = '';
252
+ }
253
+
254
+ if (typeof obj === 'string' ||
255
+ typeof obj === 'number' ||
256
+ typeof obj === 'boolean') {
257
+
258
+ return [Utils.encode(prefix) + '=' + Utils.encode(obj)];
259
+ }
260
+
261
+ var values = [];
262
+
263
+ if (typeof obj === 'undefined') {
264
+ return values;
265
+ }
266
+
267
+ var objKeys = Array.isArray(filter) ? filter : Object.keys(obj);
268
+ for (var i = 0, il = objKeys.length; i < il; ++i) {
269
+ var key = objKeys[i];
270
+
271
+ if (Array.isArray(obj)) {
272
+ values = values.concat(internals.stringify(obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, filter));
273
+ }
274
+ else {
275
+ values = values.concat(internals.stringify(obj[key], prefix + '[' + key + ']', generateArrayPrefix, strictNullHandling, filter));
276
+ }
277
+ }
278
+
279
+ return values;
280
+ };
281
+
282
+
283
+ module.exports = function (obj, options) {
284
+
285
+ options = options || {};
286
+ var delimiter = typeof options.delimiter === 'undefined' ? internals.delimiter : options.delimiter;
287
+ var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : internals.strictNullHandling;
288
+ var objKeys;
289
+ var filter;
290
+ if (typeof options.filter === 'function') {
291
+ filter = options.filter;
292
+ obj = filter('', obj);
293
+ }
294
+ else if (Array.isArray(options.filter)) {
295
+ objKeys = filter = options.filter;
296
+ }
297
+
298
+ var keys = [];
299
+
300
+ if (typeof obj !== 'object' ||
301
+ obj === null) {
302
+
303
+ return '';
304
+ }
305
+
306
+ var arrayFormat;
307
+ if (options.arrayFormat in internals.arrayPrefixGenerators) {
308
+ arrayFormat = options.arrayFormat;
309
+ }
310
+ else if ('indices' in options) {
311
+ arrayFormat = options.indices ? 'indices' : 'repeat';
312
+ }
313
+ else {
314
+ arrayFormat = 'indices';
315
+ }
316
+
317
+ var generateArrayPrefix = internals.arrayPrefixGenerators[arrayFormat];
318
+
319
+ if (!objKeys) {
320
+ objKeys = Object.keys(obj);
321
+ }
322
+ for (var i = 0, il = objKeys.length; i < il; ++i) {
323
+ var key = objKeys[i];
324
+ keys = keys.concat(internals.stringify(obj[key], key, generateArrayPrefix, strictNullHandling, filter));
325
+ }
326
+
327
+ return keys.join(delimiter);
328
+ };
329
+
330
+ },{"./utils":4}],4:[function(require,module,exports){
331
+ // Load modules
332
+
333
+
334
+ // Declare internals
335
+
336
+ var internals = {};
337
+ internals.hexTable = new Array(256);
338
+ for (var h = 0; h < 256; ++h) {
339
+ internals.hexTable[h] = '%' + ((h < 16 ? '0' : '') + h.toString(16)).toUpperCase();
340
+ }
341
+
342
+
343
+ exports.arrayToObject = function (source, options) {
344
+
345
+ var obj = options.plainObjects ? Object.create(null) : {};
346
+ for (var i = 0, il = source.length; i < il; ++i) {
347
+ if (typeof source[i] !== 'undefined') {
348
+
349
+ obj[i] = source[i];
350
+ }
351
+ }
352
+
353
+ return obj;
354
+ };
355
+
356
+
357
+ exports.merge = function (target, source, options) {
358
+
359
+ if (!source) {
360
+ return target;
361
+ }
362
+
363
+ if (typeof source !== 'object') {
364
+ if (Array.isArray(target)) {
365
+ target.push(source);
366
+ }
367
+ else if (typeof target === 'object') {
368
+ target[source] = true;
369
+ }
370
+ else {
371
+ target = [target, source];
372
+ }
373
+
374
+ return target;
375
+ }
376
+
377
+ if (typeof target !== 'object') {
378
+ target = [target].concat(source);
379
+ return target;
380
+ }
381
+
382
+ if (Array.isArray(target) &&
383
+ !Array.isArray(source)) {
384
+
385
+ target = exports.arrayToObject(target, options);
386
+ }
387
+
388
+ var keys = Object.keys(source);
389
+ for (var k = 0, kl = keys.length; k < kl; ++k) {
390
+ var key = keys[k];
391
+ var value = source[key];
392
+
393
+ if (!Object.prototype.hasOwnProperty.call(target, key)) {
394
+ target[key] = value;
395
+ }
396
+ else {
397
+ target[key] = exports.merge(target[key], value, options);
398
+ }
399
+ }
400
+
401
+ return target;
402
+ };
403
+
404
+
405
+ exports.decode = function (str) {
406
+
407
+ try {
408
+ return decodeURIComponent(str.replace(/\+/g, ' '));
409
+ } catch (e) {
410
+ return str;
411
+ }
412
+ };
413
+
414
+ exports.encode = function (str) {
415
+
416
+ // This code was originally written by Brian White (mscdex) for the io.js core querystring library.
417
+ // It has been adapted here for stricter adherence to RFC 3986
418
+ if (str.length === 0) {
419
+ return str;
420
+ }
421
+
422
+ if (typeof str !== 'string') {
423
+ str = '' + str;
424
+ }
425
+
426
+ var out = '';
427
+ for (var i = 0, il = str.length; i < il; ++i) {
428
+ var c = str.charCodeAt(i);
429
+
430
+ if (c === 0x2D || // -
431
+ c === 0x2E || // .
432
+ c === 0x5F || // _
433
+ c === 0x7E || // ~
434
+ (c >= 0x30 && c <= 0x39) || // 0-9
435
+ (c >= 0x41 && c <= 0x5A) || // a-z
436
+ (c >= 0x61 && c <= 0x7A)) { // A-Z
437
+
438
+ out += str[i];
439
+ continue;
440
+ }
441
+
442
+ if (c < 0x80) {
443
+ out += internals.hexTable[c];
444
+ continue;
445
+ }
446
+
447
+ if (c < 0x800) {
448
+ out += internals.hexTable[0xC0 | (c >> 6)] + internals.hexTable[0x80 | (c & 0x3F)];
449
+ continue;
450
+ }
451
+
452
+ if (c < 0xD800 || c >= 0xE000) {
453
+ out += internals.hexTable[0xE0 | (c >> 12)] + internals.hexTable[0x80 | ((c >> 6) & 0x3F)] + internals.hexTable[0x80 | (c & 0x3F)];
454
+ continue;
455
+ }
456
+
457
+ ++i;
458
+ c = 0x10000 + (((c & 0x3FF) << 10) | (str.charCodeAt(i) & 0x3FF));
459
+ out += internals.hexTable[0xF0 | (c >> 18)] + internals.hexTable[0x80 | ((c >> 12) & 0x3F)] + internals.hexTable[0x80 | ((c >> 6) & 0x3F)] + internals.hexTable[0x80 | (c & 0x3F)];
460
+ }
461
+
462
+ return out;
463
+ };
464
+
465
+ exports.compact = function (obj, refs) {
466
+
467
+ if (typeof obj !== 'object' ||
468
+ obj === null) {
469
+
470
+ return obj;
471
+ }
472
+
473
+ refs = refs || [];
474
+ var lookup = refs.indexOf(obj);
475
+ if (lookup !== -1) {
476
+ return refs[lookup];
477
+ }
478
+
479
+ refs.push(obj);
480
+
481
+ if (Array.isArray(obj)) {
482
+ var compacted = [];
483
+
484
+ for (var i = 0, il = obj.length; i < il; ++i) {
485
+ if (typeof obj[i] !== 'undefined') {
486
+ compacted.push(obj[i]);
487
+ }
488
+ }
489
+
490
+ return compacted;
491
+ }
492
+
493
+ var keys = Object.keys(obj);
494
+ for (i = 0, il = keys.length; i < il; ++i) {
495
+ var key = keys[i];
496
+ obj[key] = exports.compact(obj[key], refs);
497
+ }
498
+
499
+ return obj;
500
+ };
501
+
502
+
503
+ exports.isRegExp = function (obj) {
504
+
505
+ return Object.prototype.toString.call(obj) === '[object RegExp]';
506
+ };
507
+
508
+
509
+ exports.isBuffer = function (obj) {
510
+
511
+ if (obj === null ||
512
+ typeof obj === 'undefined') {
513
+
514
+ return false;
515
+ }
516
+
517
+ return !!(obj.constructor &&
518
+ obj.constructor.isBuffer &&
519
+ obj.constructor.isBuffer(obj));
520
+ };
521
+
522
+ },{}]},{},[1])(1)
523
+ });
@@ -12,7 +12,8 @@ var internals = {
12
12
  parameterLimit: 1000,
13
13
  strictNullHandling: false,
14
14
  plainObjects: false,
15
- allowPrototypes: false
15
+ allowPrototypes: false,
16
+ allowDots: false
16
17
  };
17
18
 
18
19
 
@@ -157,7 +158,7 @@ module.exports = function (str, options) {
157
158
  options.depth = typeof options.depth === 'number' ? options.depth : internals.depth;
158
159
  options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : internals.arrayLimit;
159
160
  options.parseArrays = options.parseArrays !== false;
160
- options.allowDots = options.allowDots !== false;
161
+ options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : internals.allowDots;
161
162
  options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : internals.plainObjects;
162
163
  options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : internals.allowPrototypes;
163
164
  options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : internals.parameterLimit;
@@ -21,11 +21,13 @@ var internals = {
21
21
  return prefix;
22
22
  }
23
23
  },
24
- strictNullHandling: false
24
+ strictNullHandling: false,
25
+ skipNulls: false,
26
+ encode: true
25
27
  };
26
28
 
27
29
 
28
- internals.stringify = function (obj, prefix, generateArrayPrefix, strictNullHandling, filter) {
30
+ internals.stringify = function (obj, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter) {
29
31
 
30
32
  if (typeof filter === 'function') {
31
33
  obj = filter(prefix, obj);
@@ -38,7 +40,7 @@ internals.stringify = function (obj, prefix, generateArrayPrefix, strictNullHand
38
40
  }
39
41
  else if (obj === null) {
40
42
  if (strictNullHandling) {
41
- return Utils.encode(prefix);
43
+ return encode ? Utils.encode(prefix) : prefix;
42
44
  }
43
45
 
44
46
  obj = '';
@@ -48,7 +50,10 @@ internals.stringify = function (obj, prefix, generateArrayPrefix, strictNullHand
48
50
  typeof obj === 'number' ||
49
51
  typeof obj === 'boolean') {
50
52
 
51
- return [Utils.encode(prefix) + '=' + Utils.encode(obj)];
53
+ if (encode) {
54
+ return [Utils.encode(prefix) + '=' + Utils.encode(obj)];
55
+ }
56
+ return [prefix + '=' + obj];
52
57
  }
53
58
 
54
59
  var values = [];
@@ -61,11 +66,17 @@ internals.stringify = function (obj, prefix, generateArrayPrefix, strictNullHand
61
66
  for (var i = 0, il = objKeys.length; i < il; ++i) {
62
67
  var key = objKeys[i];
63
68
 
69
+ if (skipNulls &&
70
+ obj[key] === null) {
71
+
72
+ continue;
73
+ }
74
+
64
75
  if (Array.isArray(obj)) {
65
- values = values.concat(internals.stringify(obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, filter));
76
+ values = values.concat(internals.stringify(obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, skipNulls, encode, filter));
66
77
  }
67
78
  else {
68
- values = values.concat(internals.stringify(obj[key], prefix + '[' + key + ']', generateArrayPrefix, strictNullHandling, filter));
79
+ values = values.concat(internals.stringify(obj[key], prefix + '[' + key + ']', generateArrayPrefix, strictNullHandling, skipNulls, encode, filter));
69
80
  }
70
81
  }
71
82
 
@@ -78,6 +89,8 @@ module.exports = function (obj, options) {
78
89
  options = options || {};
79
90
  var delimiter = typeof options.delimiter === 'undefined' ? internals.delimiter : options.delimiter;
80
91
  var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : internals.strictNullHandling;
92
+ var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : internals.skipNulls;
93
+ var encode = typeof options.encode === 'boolean' ? options.encode : internals.encode;
81
94
  var objKeys;
82
95
  var filter;
83
96
  if (typeof options.filter === 'function') {
@@ -112,9 +125,17 @@ module.exports = function (obj, options) {
112
125
  if (!objKeys) {
113
126
  objKeys = Object.keys(obj);
114
127
  }
128
+
115
129
  for (var i = 0, il = objKeys.length; i < il; ++i) {
116
130
  var key = objKeys[i];
117
- keys = keys.concat(internals.stringify(obj[key], key, generateArrayPrefix, strictNullHandling, filter));
131
+
132
+ if (skipNulls &&
133
+ obj[key] === null) {
134
+
135
+ continue;
136
+ }
137
+
138
+ keys = keys.concat(internals.stringify(obj[key], key, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter));
118
139
  }
119
140
 
120
141
  return keys.join(delimiter);
@@ -1,9 +1,18 @@
1
1
  {
2
2
  "name": "qs",
3
- "version": "4.0.0",
4
3
  "description": "A querystring parser that supports nesting and arrays, with a depth limit",
5
4
  "homepage": "https://github.com/hapijs/qs",
5
+ "version": "5.1.0",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/hapijs/qs.git"
9
+ },
6
10
  "main": "lib/index.js",
11
+ "keywords": [
12
+ "querystring",
13
+ "qs"
14
+ ],
15
+ "engines": ">=0.10.40",
7
16
  "dependencies": {},
8
17
  "devDependencies": {
9
18
  "browserify": "^10.2.1",
@@ -12,34 +21,27 @@
12
21
  },
13
22
  "scripts": {
14
23
  "test": "lab -a code -t 100 -L",
24
+ "test-tap": "lab -a code -r tap -o tests.tap",
15
25
  "test-cov-html": "lab -a code -r html -o coverage.html",
16
26
  "dist": "browserify --standalone Qs lib/index.js > dist/qs.js"
17
27
  },
18
- "repository": {
19
- "type": "git",
20
- "url": "git+https://github.com/hapijs/qs.git"
21
- },
22
- "keywords": [
23
- "querystring",
24
- "qs"
25
- ],
26
28
  "license": "BSD-3-Clause",
27
- "gitHead": "e573dd08eae6cce30d2202704691a102dfa3782a",
29
+ "gitHead": "9e9759ec5be2dd99ce90961bbff47075cd5a8160",
28
30
  "bugs": {
29
31
  "url": "https://github.com/hapijs/qs/issues"
30
32
  },
31
- "_id": "qs@4.0.0",
32
- "_shasum": "c31d9b74ec27df75e543a86c78728ed8d4623607",
33
- "_from": "qs@~4.0.0",
34
- "_npmVersion": "2.12.0",
35
- "_nodeVersion": "0.12.4",
33
+ "_id": "qs@5.1.0",
34
+ "_shasum": "4d932e5c7ea411cca76a312d39a606200fd50cd9",
35
+ "_from": "qs@~5.1.0",
36
+ "_npmVersion": "2.14.1",
37
+ "_nodeVersion": "0.12.7",
36
38
  "_npmUser": {
37
39
  "name": "nlf",
38
40
  "email": "quitlahok@gmail.com"
39
41
  },
40
42
  "dist": {
41
- "shasum": "c31d9b74ec27df75e543a86c78728ed8d4623607",
42
- "tarball": "http://registry.npmjs.org/qs/-/qs-4.0.0.tgz"
43
+ "shasum": "4d932e5c7ea411cca76a312d39a606200fd50cd9",
44
+ "tarball": "http://registry.npmjs.org/qs/-/qs-5.1.0.tgz"
43
45
  },
44
46
  "maintainers": [
45
47
  {
@@ -52,5 +54,5 @@
52
54
  }
53
55
  ],
54
56
  "directories": {},
55
- "_resolved": "https://registry.npmjs.org/qs/-/qs-4.0.0.tgz"
57
+ "_resolved": "https://registry.npmjs.org/qs/-/qs-5.1.0.tgz"
56
58
  }