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
@@ -47,10 +47,10 @@ describe('parse()', function () {
47
47
  done();
48
48
  });
49
49
 
50
- it('allows disabling dot notation', function (done) {
50
+ it('allows enabling dot notation', function (done) {
51
51
 
52
- expect(Qs.parse('a.b=c')).to.deep.equal({ a: { b: 'c' } });
53
- expect(Qs.parse('a.b=c', { allowDots: false })).to.deep.equal({ 'a.b': 'c' });
52
+ expect(Qs.parse('a.b=c')).to.deep.equal({ 'a.b': 'c' });
53
+ expect(Qs.parse('a.b=c', { allowDots: true })).to.deep.equal({ a: { b: 'c' } });
54
54
  done();
55
55
  });
56
56
 
@@ -175,16 +175,16 @@ describe('parse()', function () {
175
175
 
176
176
  it('transforms arrays to objects (dot notation)', function (done) {
177
177
 
178
- expect(Qs.parse('foo[0].baz=bar&fool.bad=baz')).to.deep.equal({ foo: [{ baz: 'bar' }], fool: { bad: 'baz' } });
179
- expect(Qs.parse('foo[0].baz=bar&fool.bad.boo=baz')).to.deep.equal({ foo: [{ baz: 'bar' }], fool: { bad: { boo: 'baz' } } });
180
- expect(Qs.parse('foo[0][0].baz=bar&fool.bad=baz')).to.deep.equal({ foo: [[{ baz: 'bar' }]], fool: { bad: 'baz' } });
181
- expect(Qs.parse('foo[0].baz[0]=15&foo[0].bar=2')).to.deep.equal({ foo: [{ baz: ['15'], bar: '2' }] });
182
- expect(Qs.parse('foo[0].baz[0]=15&foo[0].baz[1]=16&foo[0].bar=2')).to.deep.equal({ foo: [{ baz: ['15', '16'], bar: '2' }] });
183
- expect(Qs.parse('foo.bad=baz&foo[0]=bar')).to.deep.equal({ foo: { bad: 'baz', '0': 'bar' } });
184
- expect(Qs.parse('foo.bad=baz&foo[]=bar')).to.deep.equal({ foo: { bad: 'baz', '0': 'bar' } });
185
- expect(Qs.parse('foo[]=bar&foo.bad=baz')).to.deep.equal({ foo: { '0': 'bar', bad: 'baz' } });
186
- expect(Qs.parse('foo.bad=baz&foo[]=bar&foo[]=foo')).to.deep.equal({ foo: { bad: 'baz', '0': 'bar', '1': 'foo' } });
187
- expect(Qs.parse('foo[0].a=a&foo[0].b=b&foo[1].a=aa&foo[1].b=bb')).to.deep.equal({ foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] });
178
+ expect(Qs.parse('foo[0].baz=bar&fool.bad=baz', { allowDots: true })).to.deep.equal({ foo: [{ baz: 'bar' }], fool: { bad: 'baz' } });
179
+ expect(Qs.parse('foo[0].baz=bar&fool.bad.boo=baz', { allowDots: true })).to.deep.equal({ foo: [{ baz: 'bar' }], fool: { bad: { boo: 'baz' } } });
180
+ expect(Qs.parse('foo[0][0].baz=bar&fool.bad=baz', { allowDots: true })).to.deep.equal({ foo: [[{ baz: 'bar' }]], fool: { bad: 'baz' } });
181
+ expect(Qs.parse('foo[0].baz[0]=15&foo[0].bar=2', { allowDots: true })).to.deep.equal({ foo: [{ baz: ['15'], bar: '2' }] });
182
+ expect(Qs.parse('foo[0].baz[0]=15&foo[0].baz[1]=16&foo[0].bar=2', { allowDots: true })).to.deep.equal({ foo: [{ baz: ['15', '16'], bar: '2' }] });
183
+ expect(Qs.parse('foo.bad=baz&foo[0]=bar', { allowDots: true })).to.deep.equal({ foo: { bad: 'baz', '0': 'bar' } });
184
+ expect(Qs.parse('foo.bad=baz&foo[]=bar', { allowDots: true })).to.deep.equal({ foo: { bad: 'baz', '0': 'bar' } });
185
+ expect(Qs.parse('foo[]=bar&foo.bad=baz', { allowDots: true })).to.deep.equal({ foo: { '0': 'bar', bad: 'baz' } });
186
+ expect(Qs.parse('foo.bad=baz&foo[]=bar&foo[]=foo', { allowDots: true })).to.deep.equal({ foo: { bad: 'baz', '0': 'bar', '1': 'foo' } });
187
+ expect(Qs.parse('foo[0].a=a&foo[0].b=b&foo[1].a=aa&foo[1].b=bb', { allowDots: true })).to.deep.equal({ foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] });
188
188
  done();
189
189
  });
190
190
 
@@ -372,7 +372,7 @@ describe('parse()', function () {
372
372
  }
373
373
  };
374
374
 
375
- var result = Qs.parse(input);
375
+ var result = Qs.parse(input, { allowDots: true });
376
376
 
377
377
  expect(result).to.deep.equal(expected);
378
378
  done();
@@ -47,6 +47,19 @@ describe('stringify()', function () {
47
47
  done();
48
48
  });
49
49
 
50
+ it('omits nulls when asked', function (done) {
51
+
52
+ expect(Qs.stringify({ a: 'b', c: null }, { skipNulls: true })).to.equal('a=b');
53
+ done();
54
+ });
55
+
56
+
57
+ it('omits nested nulls when asked', function (done) {
58
+
59
+ expect(Qs.stringify({ a: { b: 'c', d: null } }, { skipNulls: true })).to.equal('a%5Bb%5D=c');
60
+ done();
61
+ });
62
+
50
63
  it('omits array indices when asked', function (done) {
51
64
 
52
65
  expect(Qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false })).to.equal('a=b&a=c&a=d');
@@ -216,8 +229,9 @@ describe('stringify()', function () {
216
229
 
217
230
  var tempBuffer = global.Buffer;
218
231
  delete global.Buffer;
219
- expect(Qs.stringify({ a: 'b', c: 'd' })).to.equal('a=b&c=d');
232
+ var result = Qs.stringify({ a: 'b', c: 'd' });
220
233
  global.Buffer = tempBuffer;
234
+ expect(result).to.equal('a=b&c=d');
221
235
  done();
222
236
  });
223
237
 
@@ -256,4 +270,12 @@ describe('stringify()', function () {
256
270
  done();
257
271
 
258
272
  });
273
+
274
+ it('can disable uri encoding', function (done) {
275
+
276
+ expect(Qs.stringify({ a: 'b' }, { encode: false })).to.equal('a=b');
277
+ expect(Qs.stringify({ a: { b: 'c' } }, { encode: false })).to.equal('a[b]=c');
278
+ expect(Qs.stringify({ a: 'b', c: null }, { strictNullHandling: true, encode: false })).to.equal('a=b&c');
279
+ done();
280
+ });
259
281
  });
@@ -16,7 +16,7 @@
16
16
  ],
17
17
  "repository": {
18
18
  "type": "git",
19
- "url": "git+https://github.com/mhart/StringStream.git"
19
+ "url": "https://github.com/mhart/StringStream.git"
20
20
  },
21
21
  "license": "MIT",
22
22
  "readme": "# Decode streams into strings The Right Way(tm)\n\n```javascript\nvar fs = require('fs')\nvar zlib = require('zlib')\nvar strs = require('stringstream')\n\nvar utf8Stream = fs.createReadStream('massiveLogFile.gz')\n .pipe(zlib.createGunzip())\n .pipe(strs('utf8'))\n```\n\nNo need to deal with `setEncoding()` weirdness, just compose streams\nlike they were supposed to be!\n\nHandles input and output encoding:\n\n```javascript\n// Stream from utf8 to hex to base64... Why not, ay.\nvar hex64Stream = fs.createReadStream('myFile')\n .pipe(strs('utf8', 'hex'))\n .pipe(strs('hex', 'base64'))\n```\n\nAlso deals with `base64` output correctly by aligning each emitted data\nchunk so that there are no dangling `=` characters:\n\n```javascript\nvar stream = fs.createReadStream('myFile').pipe(strs('base64'))\n\nvar base64Str = ''\n\nstream.on('data', function(data) { base64Str += data })\nstream.on('end', function() {\n console.log('My base64 encoded file is: ' + base64Str) // Wouldn't work with setEncoding()\n console.log('Original file is: ' + new Buffer(base64Str, 'base64'))\n})\n```\n",
@@ -7,7 +7,7 @@
7
7
  "util",
8
8
  "utility"
9
9
  ],
10
- "version": "2.60.0",
10
+ "version": "2.63.0",
11
11
  "author": {
12
12
  "name": "Mikeal Rogers",
13
13
  "email": "mikeal.rogers@gmail.com"
@@ -33,7 +33,7 @@
33
33
  "json-stringify-safe": "~5.0.0",
34
34
  "mime-types": "~2.1.2",
35
35
  "node-uuid": "~1.4.0",
36
- "qs": "~4.0.0",
36
+ "qs": "~5.1.0",
37
37
  "tunnel-agent": "~0.4.0",
38
38
  "tough-cookie": ">=0.12.0",
39
39
  "http-signature": "~0.11.0",
@@ -73,21 +73,17 @@
73
73
  "taper": "~0.4.0",
74
74
  "bluebird": "~2.9.21"
75
75
  },
76
- "gitHead": "af19cef3bc60e9151ffce5015d8ce3c0728d3aca",
76
+ "gitHead": "e1c36a0d10cab1466262efddd6cc54f80d88be9c",
77
77
  "homepage": "https://github.com/request/request#readme",
78
- "_id": "request@2.60.0",
79
- "_shasum": "498820957fcdded1d37749069610c85f61a29f2d",
78
+ "_id": "request@2.63.0",
79
+ "_shasum": "c83e7c3485e5d9bf9b146318429bc48f1253d8be",
80
80
  "_from": "request@2.x",
81
- "_npmVersion": "2.11.2",
82
- "_nodeVersion": "0.12.6",
81
+ "_npmVersion": "2.14.3",
82
+ "_nodeVersion": "4.1.0",
83
83
  "_npmUser": {
84
84
  "name": "simov",
85
85
  "email": "simeonvelichkov@gmail.com"
86
86
  },
87
- "dist": {
88
- "shasum": "498820957fcdded1d37749069610c85f61a29f2d",
89
- "tarball": "http://registry.npmjs.org/request/-/request-2.60.0.tgz"
90
- },
91
87
  "maintainers": [
92
88
  {
93
89
  "name": "mikeal",
@@ -106,6 +102,10 @@
106
102
  "email": "simeonvelichkov@gmail.com"
107
103
  }
108
104
  ],
105
+ "dist": {
106
+ "shasum": "c83e7c3485e5d9bf9b146318429bc48f1253d8be",
107
+ "tarball": "http://registry.npmjs.org/request/-/request-2.63.0.tgz"
108
+ },
109
109
  "directories": {},
110
- "_resolved": "https://registry.npmjs.org/request/-/request-2.60.0.tgz"
110
+ "_resolved": "https://registry.npmjs.org/request/-/request-2.63.0.tgz"
111
111
  }
@@ -256,17 +256,7 @@ Request.prototype.init = function (options) {
256
256
 
257
257
  // Support Unix Sockets
258
258
  if (self.uri.host === 'unix') {
259
- // Get the socket & request paths from the URL
260
- var unixParts = self.uri.path.split(':')
261
- , host = unixParts[0]
262
- , path = unixParts[1]
263
- // Apply unix properties to request
264
- self.socketPath = host
265
- self.uri.pathname = path
266
- self.uri.path = path
267
- self.uri.host = host
268
- self.uri.hostname = host
269
- self.uri.isUnix = true
259
+ self.enableUnixSocket()
270
260
  }
271
261
 
272
262
  if (self.strictSSL === false) {
@@ -432,13 +422,18 @@ Request.prototype.init = function (options) {
432
422
  }
433
423
 
434
424
  function setContentLength () {
435
- if (!Buffer.isBuffer(self.body) && !Array.isArray(self.body)) {
436
- self.body = new Buffer(self.body)
437
- }
438
425
  if (!self.hasHeader('content-length')) {
439
- var length = (Array.isArray(self.body))
440
- ? self.body.reduce(function (a, b) {return a + b.length}, 0)
441
- : self.body.length
426
+ var length
427
+ if (typeof self.body === 'string') {
428
+ length = Buffer.byteLength(self.body)
429
+ }
430
+ else if (Array.isArray(self.body)) {
431
+ length = self.body.reduce(function (a, b) {return a + b.length}, 0)
432
+ }
433
+ else {
434
+ length = self.body.length
435
+ }
436
+
442
437
  if (length) {
443
438
  self.setHeader('content-length', length)
444
439
  } else {
@@ -483,10 +478,9 @@ Request.prototype.init = function (options) {
483
478
  if (v.major === 0 && v.minor <= 10) {
484
479
  self.agentClass = protocol === 'http:' ? ForeverAgent : ForeverAgent.SSL
485
480
  } else {
486
- self.agent = new self.httpModule.Agent({
487
- keepAlive: true,
488
- maxSockets: (options.pool && options.pool.maxSockets) || Infinity
489
- })
481
+ self.agentClass = self.httpModule.Agent
482
+ self.agentOptions = self.agentOptions || {}
483
+ self.agentOptions.keepAlive = true
490
484
  }
491
485
  } else {
492
486
  self.agentClass = self.httpModule.Agent
@@ -804,21 +798,33 @@ Request.prototype.start = function () {
804
798
 
805
799
  if (self.timeout && !self.timeoutTimer) {
806
800
  var timeout = self.timeout < 0 ? 0 : self.timeout
801
+ // Set a timeout in memory - this block will throw if the server takes more
802
+ // than `timeout` to write the HTTP status and headers (corresponding to
803
+ // the on('response') event on the client). NB: this measures wall-clock
804
+ // time, not the time between bytes sent by the server.
807
805
  self.timeoutTimer = setTimeout(function () {
806
+ var connectTimeout = self.req.socket && self.req.socket.readable === false
808
807
  self.abort()
809
808
  var e = new Error('ETIMEDOUT')
810
809
  e.code = 'ETIMEDOUT'
810
+ e.connect = connectTimeout
811
811
  self.emit('error', e)
812
812
  }, timeout)
813
813
 
814
- // Set additional timeout on socket - in case if remote
815
- // server freeze after sending headers
816
814
  if (self.req.setTimeout) { // only works on node 0.6+
815
+ // Set an additional timeout on the socket, via the `setsockopt` syscall.
816
+ // This timeout sets the amount of time to wait *between* bytes sent
817
+ // from the server, and may or may not correspond to the wall-clock time
818
+ // elapsed from the start of the request.
819
+ //
820
+ // In particular, it's useful for erroring if the server fails to send
821
+ // data halfway through streaming a response.
817
822
  self.req.setTimeout(timeout, function () {
818
823
  if (self.req) {
819
824
  self.req.abort()
820
825
  var e = new Error('ESOCKETTIMEDOUT')
821
826
  e.code = 'ESOCKETTIMEDOUT'
827
+ e.connect = false
822
828
  self.emit('error', e)
823
829
  }
824
830
  })
@@ -1047,7 +1053,7 @@ Request.prototype.onRequestResponse = function (response) {
1047
1053
  try {
1048
1054
  response.body = JSON.parse(response.body, self._jsonReviver)
1049
1055
  } catch (e) {
1050
- // empty
1056
+ debug('invalid JSON received', self.uri.href)
1051
1057
  }
1052
1058
  }
1053
1059
  debug('emitting complete', self.uri.href)
@@ -1147,6 +1153,10 @@ Request.prototype.qs = function (q, clobber) {
1147
1153
  self.url = self.uri
1148
1154
  self.path = self.uri.path
1149
1155
 
1156
+ if (self.uri.host === 'unix') {
1157
+ self.enableUnixSocket()
1158
+ }
1159
+
1150
1160
  return self
1151
1161
  }
1152
1162
  Request.prototype.form = function (form) {
@@ -1188,6 +1198,9 @@ Request.prototype.json = function (val) {
1188
1198
  }
1189
1199
 
1190
1200
  self._json = true
1201
+ if (!self.hasHeader('content-type')) {
1202
+ self.setHeader('content-type', 'application/json')
1203
+ }
1191
1204
  if (typeof val === 'boolean') {
1192
1205
  if (self.body !== undefined) {
1193
1206
  if (!/^application\/x-www-form-urlencoded\b/.test(self.getHeader('content-type'))) {
@@ -1195,15 +1208,9 @@ Request.prototype.json = function (val) {
1195
1208
  } else {
1196
1209
  self.body = self._qs.rfc3986(self.body)
1197
1210
  }
1198
- if (!self.hasHeader('content-type')) {
1199
- self.setHeader('content-type', 'application/json')
1200
- }
1201
1211
  }
1202
1212
  } else {
1203
1213
  self.body = safeStringify(val)
1204
- if (!self.hasHeader('content-type')) {
1205
- self.setHeader('content-type', 'application/json')
1206
- }
1207
1214
  }
1208
1215
 
1209
1216
  if (typeof self.jsonReviver === 'function') {
@@ -1230,6 +1237,20 @@ Request.prototype.getHeader = function (name, headers) {
1230
1237
  })
1231
1238
  return result
1232
1239
  }
1240
+ Request.prototype.enableUnixSocket = function () {
1241
+ // Get the socket & request paths from the URL
1242
+ var unixParts = this.uri.path.split(':')
1243
+ , host = unixParts[0]
1244
+ , path = unixParts[1]
1245
+ // Apply unix properties to request
1246
+ this.socketPath = host
1247
+ this.uri.pathname = path
1248
+ this.uri.path = path
1249
+ this.uri.host = host
1250
+ this.uri.hostname = host
1251
+ this.uri.isUnix = true
1252
+ }
1253
+
1233
1254
 
1234
1255
  Request.prototype.auth = function (user, pass, sendImmediately, bearer) {
1235
1256
  var self = this
@@ -30,7 +30,7 @@
30
30
  "shasum": "b17d08d326b4423e568eff719f91b0b1cbdf69f1",
31
31
  "tarball": "http://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
32
32
  },
33
- "_from": "inherits@~2.0.1",
33
+ "_from": "inherits@2",
34
34
  "_npmVersion": "1.3.8",
35
35
  "_npmUser": {
36
36
  "name": "isaacs",
@@ -40,7 +40,7 @@
40
40
  "homepage": "https://github.com/isaacs/minimatch#readme",
41
41
  "_id": "minimatch@2.0.10",
42
42
  "_shasum": "8d087c39c6b38c001b97fca7ce6d0e1e80afbac7",
43
- "_from": "minimatch@2.0.x",
43
+ "_from": "minimatch@^2.0.1",
44
44
  "_npmVersion": "3.1.0",
45
45
  "_nodeVersion": "2.2.1",
46
46
  "_npmUser": {
@@ -58,5 +58,6 @@
58
58
  }
59
59
  ],
60
60
  "directories": {},
61
- "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz"
61
+ "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz",
62
+ "readme": "ERROR: No README data found!"
62
63
  }
@@ -68,5 +68,6 @@
68
68
  }
69
69
  ],
70
70
  "directories": {},
71
- "_resolved": "https://registry.npmjs.org/glob/-/glob-5.0.14.tgz"
71
+ "_resolved": "https://registry.npmjs.org/glob/-/glob-5.0.14.tgz",
72
+ "readme": "ERROR: No README data found!"
72
73
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rimraf",
3
- "version": "2.4.2",
3
+ "version": "2.4.3",
4
4
  "main": "rimraf.js",
5
5
  "description": "A deep deletion module for node (like `rm -rf`)",
6
6
  "author": {
@@ -32,23 +32,23 @@
32
32
  "mkdirp": "^0.5.1",
33
33
  "tap": "^1.3.1"
34
34
  },
35
- "gitHead": "4359e9d3b3c0f26e6abe3139a00b93337f1689d7",
35
+ "gitHead": "ec7050f8ca14c931b847414f18466e601ca7c02e",
36
36
  "bugs": {
37
37
  "url": "https://github.com/isaacs/rimraf/issues"
38
38
  },
39
39
  "homepage": "https://github.com/isaacs/rimraf#readme",
40
- "_id": "rimraf@2.4.2",
41
- "_shasum": "ab4f39b08b72eae07c3d9fe9f4831aebfc9f431d",
40
+ "_id": "rimraf@2.4.3",
41
+ "_shasum": "e5b51c9437a4c582adb955e9f28cf8d945e272af",
42
42
  "_from": "rimraf@~2.4.0",
43
- "_npmVersion": "3.1.0",
43
+ "_npmVersion": "3.2.2",
44
44
  "_nodeVersion": "2.2.1",
45
45
  "_npmUser": {
46
46
  "name": "isaacs",
47
47
  "email": "isaacs@npmjs.com"
48
48
  },
49
49
  "dist": {
50
- "shasum": "ab4f39b08b72eae07c3d9fe9f4831aebfc9f431d",
51
- "tarball": "http://registry.npmjs.org/rimraf/-/rimraf-2.4.2.tgz"
50
+ "shasum": "e5b51c9437a4c582adb955e9f28cf8d945e272af",
51
+ "tarball": "http://registry.npmjs.org/rimraf/-/rimraf-2.4.3.tgz"
52
52
  },
53
53
  "maintainers": [
54
54
  {
@@ -57,5 +57,6 @@
57
57
  }
58
58
  ],
59
59
  "directories": {},
60
- "_resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.4.2.tgz"
60
+ "_resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.4.3.tgz",
61
+ "readme": "ERROR: No README data found!"
61
62
  }
@@ -83,7 +83,7 @@ function rimraf (p, options, cb) {
83
83
  results.forEach(function (p) {
84
84
  rimraf_(p, options, function CB (er) {
85
85
  if (er) {
86
- if (isWindows && (er.code === "EBUSY" || er.code === "ENOTEMPTY") &&
86
+ if (isWindows && (er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") &&
87
87
  busyTries < options.maxBusyTries) {
88
88
  busyTries ++
89
89
  var time = busyTries * 100
@@ -1,14 +1,13 @@
1
1
  {
2
2
  "name": "semver",
3
- "version": "5.0.1",
3
+ "version": "5.0.3",
4
4
  "description": "The semantic version parser used by npm.",
5
5
  "main": "semver.js",
6
6
  "scripts": {
7
7
  "test": "tap test/*.js"
8
8
  },
9
9
  "devDependencies": {
10
- "tap": "^1.2.0",
11
- "uglify-js": "~2.3.6"
10
+ "tap": "^1.3.4"
12
11
  },
13
12
  "license": "ISC",
14
13
  "repository": {
@@ -18,23 +17,23 @@
18
17
  "bin": {
19
18
  "semver": "./bin/semver"
20
19
  },
21
- "gitHead": "3408896f115cdb241684fb81f85abb0d2ecc27e9",
20
+ "gitHead": "5f89ecbe78145ad0b501cf6279f602a23c89738d",
22
21
  "bugs": {
23
22
  "url": "https://github.com/npm/node-semver/issues"
24
23
  },
25
24
  "homepage": "https://github.com/npm/node-semver#readme",
26
- "_id": "semver@5.0.1",
27
- "_shasum": "9fb3f4004f900d83c47968fe42f7583e05832cc9",
25
+ "_id": "semver@5.0.3",
26
+ "_shasum": "77466de589cd5d3c95f138aa78bc569a3cb5d27a",
28
27
  "_from": "semver@~5.0.1",
29
- "_npmVersion": "3.1.0",
30
- "_nodeVersion": "2.2.1",
28
+ "_npmVersion": "3.3.2",
29
+ "_nodeVersion": "4.0.0",
31
30
  "_npmUser": {
32
31
  "name": "isaacs",
33
32
  "email": "isaacs@npmjs.com"
34
33
  },
35
34
  "dist": {
36
- "shasum": "9fb3f4004f900d83c47968fe42f7583e05832cc9",
37
- "tarball": "http://registry.npmjs.org/semver/-/semver-5.0.1.tgz"
35
+ "shasum": "77466de589cd5d3c95f138aa78bc569a3cb5d27a",
36
+ "tarball": "http://registry.npmjs.org/semver/-/semver-5.0.3.tgz"
38
37
  },
39
38
  "maintainers": [
40
39
  {
@@ -47,6 +46,5 @@
47
46
  }
48
47
  ],
49
48
  "directories": {},
50
- "_resolved": "https://registry.npmjs.org/semver/-/semver-5.0.1.tgz",
51
- "readme": "ERROR: No README data found!"
49
+ "_resolved": "https://registry.npmjs.org/semver/-/semver-5.0.3.tgz"
52
50
  }
@@ -481,6 +481,7 @@ SemVer.prototype.inc = function(release, identifier) {
481
481
  throw new Error('invalid increment argument: ' + release);
482
482
  }
483
483
  this.format();
484
+ this.raw = this.version;
484
485
  return this;
485
486
  };
486
487
 
@@ -391,14 +391,14 @@ test('\nincrement versions test', function(t) {
391
391
  ['1.2.3-alpha.9.beta', 'prerelease', '1.2.3-alpha.10.beta', false, 'alpha'],
392
392
  ['1.2.3-alpha.10.beta', 'prerelease', '1.2.3-alpha.11.beta', false, 'alpha'],
393
393
  ['1.2.3-alpha.11.beta', 'prerelease', '1.2.3-alpha.12.beta', false, 'alpha'],
394
- ['1.2.0', 'prepatch', '1.2.1-dev.0', 'dev'],
395
- ['1.2.0-1', 'prepatch', '1.2.1-dev.0', 'dev'],
396
- ['1.2.0', 'preminor', '1.3.0-dev.0', 'dev'],
397
- ['1.2.3-1', 'preminor', '1.3.0-dev.0', 'dev'],
398
- ['1.2.0', 'premajor', '2.0.0-dev.0', 'dev'],
399
- ['1.2.3-1', 'premajor', '2.0.0-dev.0', 'dev'],
400
- ['1.2.0-1', 'minor', '1.2.0', 'dev'],
401
- ['1.0.0-1', 'major', '1.0.0', 'dev'],
394
+ ['1.2.0', 'prepatch', '1.2.1-dev.0', false, 'dev'],
395
+ ['1.2.0-1', 'prepatch', '1.2.1-dev.0', false, 'dev'],
396
+ ['1.2.0', 'preminor', '1.3.0-dev.0', false, 'dev'],
397
+ ['1.2.3-1', 'preminor', '1.3.0-dev.0', false, 'dev'],
398
+ ['1.2.0', 'premajor', '2.0.0-dev.0', false, 'dev'],
399
+ ['1.2.3-1', 'premajor', '2.0.0-dev.0', false, 'dev'],
400
+ ['1.2.0-1', 'minor', '1.2.0', false, 'dev'],
401
+ ['1.0.0-1', 'major', '1.0.0', false, 'dev'],
402
402
  ['1.2.3-dev.bar', 'prerelease', '1.2.3-dev.0', false, 'dev']
403
403
 
404
404
  ].forEach(function(v) {
@@ -410,6 +410,19 @@ test('\nincrement versions test', function(t) {
410
410
  var found = inc(pre, what, loose, id);
411
411
  var cmd = 'inc(' + pre + ', ' + what + ', ' + id + ')';
412
412
  t.equal(found, wanted, cmd + ' === ' + wanted);
413
+
414
+ var parsed = semver.parse(pre, loose);
415
+ if (wanted) {
416
+ parsed.inc(what, id);
417
+ t.equal(parsed.version, wanted, cmd + ' object version updated');
418
+ t.equal(parsed.raw, wanted, cmd + ' object raw field updated');
419
+ } else if (parsed) {
420
+ t.throws(function () {
421
+ parsed.inc(what, id)
422
+ })
423
+ } else {
424
+ t.equal(parsed, null)
425
+ }
413
426
  });
414
427
 
415
428
  t.end();
@@ -24,6 +24,7 @@ function Entry (header, extended, global) {
24
24
  this._ending = false
25
25
  this._ended = false
26
26
  this._remaining = 0
27
+ this._abort = false
27
28
  this._queue = []
28
29
  this._index = 0
29
30
  this._queueLen = 0
@@ -209,5 +210,11 @@ Entry.prototype._setProps = function () {
209
210
  this._remaining = props.size
210
211
  }
211
212
 
213
+ // the parser may not call write if _abort is true.
214
+ // useful for skipping data from some files quickly.
215
+ Entry.prototype.abort = function(){
216
+ this._abort = true
217
+ }
218
+
212
219
  Entry.prototype.warn = fstream.warn
213
220
  Entry.prototype.error = fstream.error
@@ -102,7 +102,11 @@ Parse.prototype._process = function (c) {
102
102
 
103
103
  if (this._entry) {
104
104
  var entry = this._entry
105
- entry.write(c)
105
+ if(!entry._abort) entry.write(c)
106
+ else {
107
+ entry._remaining -= c.length
108
+ if(entry._remaining < 0) entry._remaining = 0
109
+ }
106
110
  if (entry._remaining === 0) {
107
111
  entry.end()
108
112
  this._entry = null
@@ -1,11 +1,21 @@
1
- // eeeeeevvvvviiiiiiillllll
2
- // more evil than monkey-patching the native builtin?
3
- // Not sure.
4
-
5
- var mod = require("module")
6
- var pre = '(function (exports, require, module, __filename, __dirname) { '
7
- var post = '});'
8
- var src = pre + process.binding('natives').fs + post
9
- var vm = require('vm')
10
- var fn = vm.runInThisContext(src)
11
- fn(exports, require, module, __filename, __dirname)
1
+ 'use strict'
2
+
3
+ var fs = require('fs')
4
+
5
+ module.exports = clone(fs)
6
+
7
+ function clone (obj) {
8
+ if (obj === null || typeof obj !== 'object')
9
+ return obj
10
+
11
+ if (obj instanceof Object)
12
+ var copy = { __proto__: obj.__proto__ }
13
+ else
14
+ var copy = Object.create(null)
15
+
16
+ Object.getOwnPropertyNames(obj).forEach(function (key) {
17
+ Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key))
18
+ })
19
+
20
+ return copy
21
+ }