fsevents 1.0.8 → 1.0.9

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.

Potentially problematic release.


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

Files changed (194) hide show
  1. package/node_modules/ansi-styles/index.js +72 -6
  2. package/node_modules/ansi-styles/package.json +19 -12
  3. package/node_modules/ansi-styles/readme.md +36 -8
  4. package/node_modules/are-we-there-yet/CHANGES.md +19 -0
  5. package/node_modules/are-we-there-yet/README.md +12 -2
  6. package/node_modules/are-we-there-yet/index.js +4 -132
  7. package/node_modules/are-we-there-yet/package.json +18 -13
  8. package/node_modules/are-we-there-yet/test/lib/test-event.js +29 -0
  9. package/node_modules/are-we-there-yet/test/tracker.js +44 -43
  10. package/node_modules/are-we-there-yet/test/trackergroup.js +73 -64
  11. package/node_modules/are-we-there-yet/test/trackerstream.js +26 -40
  12. package/node_modules/are-we-there-yet/tracker-base.js +11 -0
  13. package/node_modules/are-we-there-yet/tracker-group.js +107 -0
  14. package/node_modules/are-we-there-yet/tracker-stream.js +35 -0
  15. package/node_modules/are-we-there-yet/tracker.js +30 -0
  16. package/node_modules/asn1/package.json +1 -2
  17. package/node_modules/assert-plus/package.json +1 -3
  18. package/node_modules/async/package.json +1 -1
  19. package/node_modules/aws4/.npmignore +2 -1
  20. package/node_modules/aws4/README.md +4 -0
  21. package/node_modules/aws4/aws4.js +8 -3
  22. package/node_modules/aws4/node_modules/lru-cache/.npmignore +3 -0
  23. package/node_modules/aws4/node_modules/lru-cache/.travis.yml +3 -4
  24. package/node_modules/aws4/node_modules/lru-cache/README.md +29 -24
  25. package/node_modules/aws4/node_modules/lru-cache/benchmarks/insertion-time.js +32 -0
  26. package/node_modules/aws4/node_modules/lru-cache/lib/lru-cache.js +333 -199
  27. package/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/LICENSE +15 -0
  28. package/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/README.md +60 -0
  29. package/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/map.js +9 -0
  30. package/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/package.json +59 -0
  31. package/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/pseudomap.js +113 -0
  32. package/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/test/basic.js +86 -0
  33. package/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/.npmignore +4 -0
  34. package/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/.travis.yml +7 -0
  35. package/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/CONTRIBUTING.md +4 -0
  36. package/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/LICENSE +15 -0
  37. package/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/README.md +204 -0
  38. package/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/package.json +59 -0
  39. package/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/test/basic.js +188 -0
  40. package/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/yallist.js +360 -0
  41. package/node_modules/aws4/node_modules/lru-cache/package.json +16 -12
  42. package/node_modules/aws4/node_modules/lru-cache/test/basic.js +270 -146
  43. package/node_modules/aws4/node_modules/lru-cache/test/foreach.js +39 -25
  44. package/node_modules/aws4/node_modules/lru-cache/test/inspect.js +54 -0
  45. package/node_modules/aws4/node_modules/lru-cache/test/no-symbol.js +3 -0
  46. package/node_modules/aws4/node_modules/lru-cache/test/serialize.js +115 -104
  47. package/node_modules/aws4/package.json +17 -14
  48. package/node_modules/bl/bl.js +9 -3
  49. package/node_modules/bl/package.json +12 -12
  50. package/node_modules/bl/test/test.js +14 -0
  51. package/node_modules/color-convert/README.md +62 -0
  52. package/node_modules/color-convert/conversions.js +594 -0
  53. package/node_modules/color-convert/css-keywords.js +151 -0
  54. package/node_modules/color-convert/index.js +75 -0
  55. package/node_modules/color-convert/package.json +92 -0
  56. package/node_modules/color-convert/route.js +98 -0
  57. package/node_modules/dashdash/lib/dashdash.js +1 -1
  58. package/node_modules/dashdash/node_modules/assert-plus/AUTHORS +6 -0
  59. package/node_modules/dashdash/node_modules/assert-plus/CHANGES.md +14 -0
  60. package/node_modules/dashdash/node_modules/assert-plus/README.md +162 -0
  61. package/node_modules/dashdash/node_modules/assert-plus/assert.js +211 -0
  62. package/node_modules/dashdash/node_modules/assert-plus/package.json +89 -0
  63. package/node_modules/dashdash/package.json +19 -12
  64. package/node_modules/ecc-jsbn/package.json +1 -2
  65. package/node_modules/escape-string-regexp/package.json +15 -11
  66. package/node_modules/extsprintf/package.json +2 -3
  67. package/node_modules/form-data/.dockerignore +7 -0
  68. package/node_modules/form-data/.editorconfig +10 -0
  69. package/node_modules/form-data/.eslintignore +1 -0
  70. package/node_modules/form-data/.eslintrc +64 -0
  71. package/node_modules/form-data/{Readme.md → README.md} +9 -1
  72. package/node_modules/form-data/lib/browser.js +2 -1
  73. package/node_modules/form-data/lib/form_data.js +172 -135
  74. package/node_modules/form-data/lib/populate.js +9 -0
  75. package/node_modules/form-data/package.json +35 -16
  76. package/node_modules/form-data/wercker.yml +36 -0
  77. package/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/index.js +1 -1
  78. package/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/package.json +14 -10
  79. package/node_modules/gauge/README.md +1 -1
  80. package/node_modules/gauge/package.json +18 -14
  81. package/node_modules/gauge/progress-bar.js +2 -2
  82. package/node_modules/http-signature/package.json +1 -2
  83. package/node_modules/is-my-json-valid/README.md +2 -2
  84. package/node_modules/is-my-json-valid/index.js +15 -6
  85. package/node_modules/is-my-json-valid/package.json +11 -7
  86. package/node_modules/is-my-json-valid/test/json-schema-draft4/multipleOf.json +36 -0
  87. package/node_modules/is-my-json-valid/test/misc.js +18 -0
  88. package/node_modules/is-typedarray/package.json +1 -2
  89. package/node_modules/isarray/.npmignore +1 -0
  90. package/node_modules/isarray/.travis.yml +4 -0
  91. package/node_modules/isarray/Makefile +6 -0
  92. package/node_modules/isarray/README.md +6 -0
  93. package/node_modules/isarray/index.js +3 -1
  94. package/node_modules/isarray/package.json +28 -10
  95. package/node_modules/isarray/test.js +20 -0
  96. package/node_modules/jodid25519/package.json +1 -2
  97. package/node_modules/jsbn/package.json +1 -2
  98. package/node_modules/json-schema/package.json +1 -1
  99. package/node_modules/jsprim/package.json +1 -2
  100. package/node_modules/lodash.pad/LICENSE +17 -16
  101. package/node_modules/lodash.pad/README.md +2 -2
  102. package/node_modules/lodash.pad/index.js +3 -94
  103. package/node_modules/lodash.pad/package.json +12 -12
  104. package/node_modules/lodash.padend/LICENSE +23 -0
  105. package/node_modules/lodash.padend/README.md +18 -0
  106. package/node_modules/lodash.padend/index.js +285 -0
  107. package/node_modules/lodash.padend/package.json +91 -0
  108. package/node_modules/lodash.padstart/LICENSE +23 -0
  109. package/node_modules/lodash.padstart/README.md +18 -0
  110. package/node_modules/lodash.padstart/index.js +285 -0
  111. package/node_modules/lodash.padstart/package.json +91 -0
  112. package/node_modules/lodash.repeat/LICENSE +17 -16
  113. package/node_modules/lodash.repeat/README.md +2 -2
  114. package/node_modules/lodash.repeat/index.js +3 -94
  115. package/node_modules/lodash.repeat/package.json +14 -13
  116. package/node_modules/lodash.tostring/LICENSE +23 -0
  117. package/node_modules/lodash.tostring/README.md +18 -0
  118. package/node_modules/lodash.tostring/index.js +164 -0
  119. package/node_modules/lodash.tostring/package.json +91 -0
  120. package/node_modules/mime-db/HISTORY.md +14 -0
  121. package/node_modules/mime-db/db.json +26 -3
  122. package/node_modules/mime-db/package.json +23 -18
  123. package/node_modules/mime-types/HISTORY.md +8 -0
  124. package/node_modules/mime-types/README.md +1 -1
  125. package/node_modules/mime-types/package.json +21 -16
  126. package/node_modules/node-pre-gyp/CHANGELOG.md +11 -0
  127. package/node_modules/node-pre-gyp/lib/util/abi_crosswalk.json +44 -4
  128. package/node_modules/node-pre-gyp/package.json +16 -16
  129. package/node_modules/npmlog/.nyc_output/64996.json +1 -0
  130. package/node_modules/npmlog/.nyc_output/64998.json +1 -0
  131. package/node_modules/npmlog/.nyc_output/65000.json +1 -0
  132. package/node_modules/npmlog/log.js +3 -2
  133. package/node_modules/npmlog/package.json +15 -11
  134. package/node_modules/npmlog/test/progress.js +25 -8
  135. package/node_modules/once/package.json +1 -1
  136. package/node_modules/qs/package.json +1 -2
  137. package/node_modules/readable-stream/.travis.yml +18 -16
  138. package/node_modules/readable-stream/README.md +1 -1
  139. package/node_modules/readable-stream/doc/stream.markdown +435 -405
  140. package/node_modules/readable-stream/lib/_stream_duplex.js +13 -20
  141. package/node_modules/readable-stream/lib/_stream_passthrough.js +3 -4
  142. package/node_modules/readable-stream/lib/_stream_readable.js +110 -205
  143. package/node_modules/readable-stream/lib/_stream_transform.js +21 -38
  144. package/node_modules/readable-stream/lib/_stream_writable.js +108 -121
  145. package/node_modules/readable-stream/package.json +19 -15
  146. package/node_modules/request/package.json +1 -2
  147. package/node_modules/rimraf/node_modules/glob/README.md +6 -0
  148. package/node_modules/rimraf/node_modules/glob/common.js +12 -3
  149. package/node_modules/rimraf/node_modules/glob/glob.js +20 -3
  150. package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js +1 -1
  151. package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +14 -10
  152. package/node_modules/rimraf/node_modules/glob/package.json +15 -11
  153. package/node_modules/rimraf/node_modules/glob/sync.js +8 -1
  154. package/node_modules/rimraf/package.json +14 -10
  155. package/node_modules/semver/package.json +1 -2
  156. package/node_modules/sshpk/lib/formats/rfc4253.js +2 -1
  157. package/node_modules/sshpk/package.json +13 -10
  158. package/node_modules/strip-ansi/package.json +21 -16
  159. package/node_modules/strip-ansi/readme.md +5 -5
  160. package/node_modules/tough-cookie/lib/cookie.js +2 -2
  161. package/node_modules/tough-cookie/package.json +13 -9
  162. package/node_modules/tweetnacl/CHANGELOG.md +53 -0
  163. package/node_modules/tweetnacl/COPYING.txt +9 -0
  164. package/node_modules/tweetnacl/README.md +14 -40
  165. package/node_modules/tweetnacl/nacl-fast.js +21 -51
  166. package/node_modules/tweetnacl/nacl-fast.min.js +2 -2
  167. package/node_modules/tweetnacl/nacl.js +21 -51
  168. package/node_modules/tweetnacl/nacl.min.js +1 -1
  169. package/node_modules/tweetnacl/package.json +28 -38
  170. package/node_modules/verror/package.json +2 -3
  171. package/package.json +2 -2
  172. package/node_modules/aws4/example.js +0 -372
  173. package/node_modules/aws4/node_modules/lru-cache/test/memory-leak.js +0 -51
  174. package/node_modules/isarray/build/build.js +0 -209
  175. package/node_modules/lodash._basetostring/LICENSE +0 -22
  176. package/node_modules/lodash._basetostring/README.md +0 -20
  177. package/node_modules/lodash._basetostring/index.js +0 -22
  178. package/node_modules/lodash._basetostring/package.json +0 -99
  179. package/node_modules/lodash._createpadding/LICENSE +0 -22
  180. package/node_modules/lodash._createpadding/README.md +0 -20
  181. package/node_modules/lodash._createpadding/index.js +0 -37
  182. package/node_modules/lodash._createpadding/package.json +0 -101
  183. package/node_modules/lodash._root/LICENSE +0 -22
  184. package/node_modules/lodash._root/README.md +0 -18
  185. package/node_modules/lodash._root/index.js +0 -53
  186. package/node_modules/lodash._root/package.json +0 -77
  187. package/node_modules/lodash.padleft/LICENSE.txt +0 -22
  188. package/node_modules/lodash.padleft/README.md +0 -20
  189. package/node_modules/lodash.padleft/index.js +0 -50
  190. package/node_modules/lodash.padleft/package.json +0 -107
  191. package/node_modules/lodash.padright/LICENSE.txt +0 -22
  192. package/node_modules/lodash.padright/README.md +0 -20
  193. package/node_modules/lodash.padright/index.js +0 -50
  194. package/node_modules/lodash.padright/package.json +0 -107
@@ -1,87 +1,96 @@
1
- "use strict"
2
- var test = require("tap").test
3
- var Tracker = require("../index.js").Tracker
4
- var TrackerGroup = require("../index.js").TrackerGroup
1
+ 'use strict'
2
+ var test = require('tap').test
3
+ var TrackerGroup = require('../index.js').TrackerGroup
4
+ var testEvent = require('./lib/test-event.js')
5
5
 
6
- var timeoutError = new Error("timeout")
7
- var testEvent = function (obj,event,next) {
8
- var timeout = setTimeout(function(){
9
- obj.removeListener(event, eventHandler)
10
- next(timeoutError)
11
- }, 10)
12
- var eventHandler = function () {
13
- var args = Array.prototype.slice.call(arguments)
14
- args.unshift(null)
15
- clearTimeout(timeout)
16
- next.apply(null, args)
17
- }
18
- obj.once(event, eventHandler)
19
- }
20
-
21
- test("TrackerGroup", function (t) {
22
- var name = "test"
6
+ test('TrackerGroup', function (t) {
7
+ var name = 'test'
23
8
 
24
9
  var track = new TrackerGroup(name)
25
- t.is(track.completed(), 0, "Nothing todo is 0 completion")
26
- testEvent(track, "change", afterFinishEmpty)
10
+ t.is(track.completed(), 0, 'Nothing todo is 0 completion')
11
+ testEvent(track, 'change', afterFinishEmpty)
27
12
  track.finish()
28
13
  var a, b
29
- function afterFinishEmpty(er, onChangeName) {
30
- t.is(er, null, "finishEmpty: on change event fired")
31
- t.is(onChangeName, name, "finishEmpty: on change emits the correct name")
32
- t.is(track.completed(), 1, "finishEmpty: Finishing an empty group actually finishes it")
14
+ function afterFinishEmpty (er, onChangeName, completion) {
15
+ t.is(er, null, 'finishEmpty: on change event fired')
16
+ t.is(onChangeName, name, 'finishEmpty: on change emits the correct name')
17
+ t.is(completion, 1, 'finishEmpty: passed through completion was correct')
18
+ t.is(track.completed(), 1, 'finishEmpty: Finishing an empty group actually finishes it')
33
19
 
34
20
  track = new TrackerGroup(name)
35
- a = track.newItem("a", 10, 1)
36
- b = track.newItem("b", 10, 1)
37
- t.is(track.completed(), 0, "Initially empty")
38
- testEvent(track, "change", afterCompleteWork)
21
+ a = track.newItem('a', 10, 1)
22
+ b = track.newItem('b', 10, 1)
23
+ t.is(track.completed(), 0, 'Initially empty')
24
+ testEvent(track, 'change', afterCompleteWork)
39
25
  a.completeWork(5)
40
26
  }
41
- function afterCompleteWork(er, onChangeName) {
42
- t.is(er, null, "on change event fired")
43
- t.is(onChangeName, "a", "on change emits the correct name")
44
- t.is(track.completed(), 0.25, "Complete half of one is a quarter overall")
45
- testEvent(track, "change", afterFinishAll)
27
+ function afterCompleteWork (er, onChangeName, completion) {
28
+ t.is(er, null, 'on change event fired')
29
+ t.is(onChangeName, 'a', 'on change emits the correct name')
30
+ t.is(completion, 0.25, 'Complete half of one is a quarter overall')
31
+ t.is(track.completed(), 0.25, 'Complete half of one is a quarter overall')
32
+ testEvent(track, 'change', afterFinishAll)
46
33
  track.finish()
47
34
  }
48
- function afterFinishAll(er, onChangeName) {
49
- t.is(er, null, "finishAll: on change event fired")
50
- t.is(onChangeName, name, "finishAll: on change emits the correct name")
51
- t.is(track.completed(), 1, "Finishing everything ")
52
-
35
+ function afterFinishAll (er, onChangeName, completion) {
36
+ t.is(er, null, 'finishAll: on change event fired')
37
+ t.is(onChangeName, name, 'finishAll: on change emits the correct name')
38
+ t.is(completion, 1, 'Finishing everything ')
39
+ t.is(track.completed(), 1, 'Finishing everything ')
40
+
53
41
  track = new TrackerGroup(name)
54
- a = track.newItem("a", 10, 2)
55
- b = track.newItem("b", 10, 1)
56
- t.is(track.completed(), 0, "weighted: Initially empty")
57
- testEvent(track, "change", afterWeightedCompleteWork)
42
+ a = track.newItem('a', 10, 2)
43
+ b = track.newItem('b', 10, 1)
44
+ t.is(track.completed(), 0, 'weighted: Initially empty')
45
+ testEvent(track, 'change', afterWeightedCompleteWork)
58
46
  a.completeWork(5)
59
47
  }
60
- function afterWeightedCompleteWork(er, onChangeName) {
61
- t.is(er, null, "weighted: on change event fired")
62
- t.is(onChangeName, "a", "weighted: on change emits the correct name")
63
- t.is(Math.round(track.completed()*100), 33, "weighted: Complete half of double weighted")
64
- testEvent(track, "change", afterWeightedFinishAll)
48
+ function afterWeightedCompleteWork (er, onChangeName, completion) {
49
+ t.is(er, null, 'weighted: on change event fired')
50
+ t.is(onChangeName, 'a', 'weighted: on change emits the correct name')
51
+ t.is(Math.floor(completion * 100), 33, 'weighted: Complete half of double weighted')
52
+ t.is(Math.floor(track.completed() * 100), 33, 'weighted: Complete half of double weighted')
53
+ testEvent(track, 'change', afterWeightedFinishAll)
65
54
  track.finish()
66
55
  }
67
- function afterWeightedFinishAll(er, onChangeName) {
68
- t.is(er, null, "weightedFinishAll: on change event fired")
69
- t.is(onChangeName, name, "weightedFinishAll: on change emits the correct name")
70
- t.is(track.completed(), 1, "weightedFinishaAll: Finishing everything ")
71
-
56
+ function afterWeightedFinishAll (er, onChangeName, completion) {
57
+ t.is(er, null, 'weightedFinishAll: on change event fired')
58
+ t.is(onChangeName, name, 'weightedFinishAll: on change emits the correct name')
59
+ t.is(completion, 1, 'weightedFinishaAll: Finishing everything ')
60
+ t.is(track.completed(), 1, 'weightedFinishaAll: Finishing everything ')
61
+
72
62
  track = new TrackerGroup(name)
73
- a = track.newGroup("a", 10)
74
- b = track.newGroup("b", 10)
75
- var a1 = a.newItem("a.1",10)
63
+ a = track.newGroup('a', 10)
64
+ b = track.newGroup('b', 10)
65
+ var a1 = a.newItem('a.1', 10)
76
66
  a1.completeWork(5)
77
- t.is(track.completed(), 0.25, "nested: Initially quarter done")
78
- testEvent(track, "change", afterNestedComplete)
67
+ t.is(track.completed(), 0.25, 'nested: Initially quarter done')
68
+ testEvent(track, 'change', afterNestedComplete)
79
69
  b.finish()
80
70
  }
81
- function afterNestedComplete(er, onChangeName) {
82
- t.is(er, null, "nestedComplete: on change event fired")
83
- t.is(onChangeName, "b", "nestedComplete: on change emits the correct name")
84
- t.is(track.completed(), 0.75, "nestedComplete: Finishing everything ")
71
+ function afterNestedComplete (er, onChangeName, completion) {
72
+ t.is(er, null, 'nestedComplete: on change event fired')
73
+ t.is(onChangeName, 'b', 'nestedComplete: on change emits the correct name')
74
+ t.is(completion, 0.75, 'nestedComplete: Finishing everything ')
75
+ t.is(track.completed(), 0.75, 'nestedComplete: Finishing everything ')
85
76
  t.end()
86
77
  }
87
78
  })
79
+
80
+ test('cycles', function (t) {
81
+ var track = new TrackerGroup('top')
82
+ testCycle(track, track)
83
+ var layer1 = track.newGroup('layer1')
84
+ testCycle(layer1, track)
85
+ t.end()
86
+
87
+ function testCycle (addTo, toAdd) {
88
+ try {
89
+ addTo.addUnit(toAdd)
90
+ t.fail(toAdd.name)
91
+ } catch (ex) {
92
+ console.log(ex)
93
+ t.pass(toAdd.name)
94
+ }
95
+ }
96
+ })
@@ -1,65 +1,51 @@
1
- "use strict"
2
- var test = require("tap").test
3
- var util = require("util")
4
- var stream = require("readable-stream")
5
- var TrackerStream = require("../index.js").TrackerStream
6
-
7
- var timeoutError = new Error("timeout")
8
- var testEvent = function (obj,event,next) {
9
- var timeout = setTimeout(function(){
10
- obj.removeListener(event, eventHandler)
11
- next(timeoutError)
12
- }, 10)
13
- var eventHandler = function () {
14
- var args = Array.prototype.slice.call(arguments)
15
- args.unshift(null)
16
- clearTimeout(timeout)
17
- next.apply(null, args)
18
- }
19
- obj.once(event, eventHandler)
20
- }
1
+ 'use strict'
2
+ var test = require('tap').test
3
+ var util = require('util')
4
+ var stream = require('readable-stream')
5
+ var TrackerStream = require('../index.js').TrackerStream
6
+ var testEvent = require('./lib/test-event.js')
21
7
 
22
8
  var Sink = function () {
23
- stream.Writable.apply(this,arguments)
9
+ stream.Writable.apply(this, arguments)
24
10
  }
25
11
  util.inherits(Sink, stream.Writable)
26
12
  Sink.prototype._write = function (data, encoding, cb) {
27
13
  cb()
28
14
  }
29
15
 
30
- test("TrackerStream", function (t) {
16
+ test('TrackerStream', function (t) {
31
17
  t.plan(9)
32
18
 
33
- var name = "test"
19
+ var name = 'test'
34
20
  var track = new TrackerStream(name)
35
21
 
36
- t.is(track.completed(), 0, "Nothing todo is 0 completion")
22
+ t.is(track.completed(), 0, 'Nothing todo is 0 completion')
37
23
 
38
24
  var todo = 10
39
25
  track = new TrackerStream(name, todo)
40
- t.is(track.completed(), 0, "Nothing done is 0 completion")
26
+ t.is(track.completed(), 0, 'Nothing done is 0 completion')
41
27
 
42
28
  track.pipe(new Sink())
43
29
 
44
- testEvent(track, "change", afterCompleteWork)
45
- track.write("0123456789")
46
- function afterCompleteWork(er, onChangeName) {
47
- t.is(er, null, "write: on change event fired")
48
- t.is(onChangeName, name, "write: on change emits the correct name")
49
- t.is(track.completed(), 1, "write: 100% completed")
30
+ testEvent(track, 'change', afterCompleteWork)
31
+ track.write('0123456789')
32
+ function afterCompleteWork (er, onChangeName) {
33
+ t.is(er, null, 'write: on change event fired')
34
+ t.is(onChangeName, name, 'write: on change emits the correct name')
35
+ t.is(track.completed(), 1, 'write: 100% completed')
50
36
 
51
- testEvent(track, "change", afterAddWork)
37
+ testEvent(track, 'change', afterAddWork)
52
38
  track.addWork(10)
53
39
  }
54
- function afterAddWork(er, onChangeName) {
55
- t.is(er, null, "addWork: on change event fired")
56
- t.is(track.completed(), 0.5, "addWork: 50% completed")
40
+ function afterAddWork (er, onChangeName) {
41
+ t.is(er, null, 'addWork: on change event fired')
42
+ t.is(track.completed(), 0.5, 'addWork: 50% completed')
57
43
 
58
- testEvent(track, "change", afterAllWork)
59
- track.write("ABCDEFGHIJKLMNOPQRST")
44
+ testEvent(track, 'change', afterAllWork)
45
+ track.write('ABCDEFGHIJKLMNOPQRST')
60
46
  }
61
- function afterAllWork(er) {
62
- t.is(er, null, "allWork: on change event fired")
63
- t.is(track.completed(), 1, "allWork: 100% completed")
47
+ function afterAllWork (er) {
48
+ t.is(er, null, 'allWork: on change event fired')
49
+ t.is(track.completed(), 1, 'allWork: 100% completed')
64
50
  }
65
51
  })
@@ -0,0 +1,11 @@
1
+ 'use strict'
2
+ var EventEmitter = require('events').EventEmitter
3
+ var util = require('util')
4
+
5
+ var trackerId = 0
6
+ var TrackerBase = module.exports = function (name) {
7
+ EventEmitter.call(this)
8
+ this.id = ++trackerId
9
+ this.name = name
10
+ }
11
+ util.inherits(TrackerBase, EventEmitter)
@@ -0,0 +1,107 @@
1
+ 'use strict'
2
+ var util = require('util')
3
+ var TrackerBase = require('./tracker-base.js')
4
+ var Tracker = require('./tracker.js')
5
+ var TrackerStream = require('./tracker-stream.js')
6
+
7
+ var TrackerGroup = module.exports = function (name) {
8
+ TrackerBase.call(this, name)
9
+ this.parentGroup = null
10
+ this.trackers = []
11
+ this.completion = {}
12
+ this.weight = {}
13
+ this.totalWeight = 0
14
+ this.finished = false
15
+ this.bubbleChange = bubbleChange(this)
16
+ }
17
+ util.inherits(TrackerGroup, TrackerBase)
18
+
19
+ function bubbleChange (trackerGroup) {
20
+ return function (name, completed, tracker) {
21
+ trackerGroup.completion[tracker.id] = completed
22
+ if (trackerGroup.finished) return
23
+ trackerGroup.emit('change', name || trackerGroup.name, trackerGroup.completed(), trackerGroup)
24
+ }
25
+ }
26
+
27
+ TrackerGroup.prototype.nameInTree = function () {
28
+ var names = []
29
+ var from = this
30
+ while (from) {
31
+ names.unshift(from.name)
32
+ from = from.parentGroup
33
+ }
34
+ return names.join('/')
35
+ }
36
+
37
+ TrackerGroup.prototype.addUnit = function (unit, weight) {
38
+ if (unit.addUnit) {
39
+ var toTest = this
40
+ while (toTest) {
41
+ if (unit === toTest) {
42
+ throw new Error(
43
+ 'Attempted to add tracker group ' +
44
+ unit.name + ' to tree that already includes it ' +
45
+ this.nameInTree(this))
46
+ }
47
+ toTest = toTest.parentGroup
48
+ }
49
+ unit.parentGroup = this
50
+ }
51
+ this.weight[unit.id] = weight || 1
52
+ this.totalWeight += this.weight[unit.id]
53
+ this.trackers.push(unit)
54
+ this.completion[unit.id] = unit.completed()
55
+ unit.on('change', this.bubbleChange)
56
+ if (!this.finished) this.emit('change', unit.name, this.completion[unit.id], unit)
57
+ return unit
58
+ }
59
+
60
+ TrackerGroup.prototype.completed = function () {
61
+ if (this.trackers.length === 0) return 0
62
+ var valPerWeight = 1 / this.totalWeight
63
+ var completed = 0
64
+ for (var ii = 0; ii < this.trackers.length; ii++) {
65
+ var trackerId = this.trackers[ii].id
66
+ completed += valPerWeight * this.weight[trackerId] * this.completion[trackerId]
67
+ }
68
+ return completed
69
+ }
70
+
71
+ TrackerGroup.prototype.newGroup = function (name, weight) {
72
+ return this.addUnit(new TrackerGroup(name), weight)
73
+ }
74
+
75
+ TrackerGroup.prototype.newItem = function (name, todo, weight) {
76
+ return this.addUnit(new Tracker(name, todo), weight)
77
+ }
78
+
79
+ TrackerGroup.prototype.newStream = function (name, todo, weight) {
80
+ return this.addUnit(new TrackerStream(name, todo), weight)
81
+ }
82
+
83
+ TrackerGroup.prototype.finish = function () {
84
+ this.finished = true
85
+ if (!this.trackers.length) this.addUnit(new Tracker(), 1, true)
86
+ for (var ii = 0; ii < this.trackers.length; ii++) {
87
+ var tracker = this.trackers[ii]
88
+ tracker.finish()
89
+ tracker.removeListener('change', this.bubbleChange)
90
+ }
91
+ this.emit('change', this.name, 1, this)
92
+ }
93
+
94
+ var buffer = ' '
95
+ TrackerGroup.prototype.debug = function (depth) {
96
+ depth = depth || 0
97
+ var indent = depth ? buffer.substr(0, depth) : ''
98
+ var output = indent + (this.name || 'top') + ': ' + this.completed() + '\n'
99
+ this.trackers.forEach(function (tracker) {
100
+ if (tracker instanceof TrackerGroup) {
101
+ output += tracker.debug(depth + 1)
102
+ } else {
103
+ output += indent + ' ' + tracker.name + ': ' + tracker.completed() + '\n'
104
+ }
105
+ })
106
+ return output
107
+ }
@@ -0,0 +1,35 @@
1
+ 'use strict'
2
+ var util = require('util')
3
+ var stream = require('readable-stream')
4
+ var delegate = require('delegates')
5
+ var Tracker = require('./tracker.js')
6
+
7
+ var TrackerStream = module.exports = function (name, size, options) {
8
+ stream.Transform.call(this, options)
9
+ this.tracker = new Tracker(name, size)
10
+ this.name = name
11
+ this.id = this.tracker.id
12
+ this.tracker.on('change', delegateChange(this))
13
+ }
14
+ util.inherits(TrackerStream, stream.Transform)
15
+
16
+ function delegateChange (trackerStream) {
17
+ return function (name, completion, tracker) {
18
+ trackerStream.emit('change', name, completion, trackerStream)
19
+ }
20
+ }
21
+
22
+ TrackerStream.prototype._transform = function (data, encoding, cb) {
23
+ this.tracker.completeWork(data.length ? data.length : 1)
24
+ this.push(data)
25
+ cb()
26
+ }
27
+
28
+ TrackerStream.prototype._flush = function (cb) {
29
+ this.tracker.finish()
30
+ cb()
31
+ }
32
+
33
+ delegate(TrackerStream.prototype, 'tracker')
34
+ .method('completed')
35
+ .method('addWork')
@@ -0,0 +1,30 @@
1
+ 'use strict'
2
+ var util = require('util')
3
+ var TrackerBase = require('./tracker-base.js')
4
+
5
+ var Tracker = module.exports = function (name, todo) {
6
+ TrackerBase.call(this, name)
7
+ this.workDone = 0
8
+ this.workTodo = todo || 0
9
+ }
10
+ util.inherits(Tracker, TrackerBase)
11
+
12
+ Tracker.prototype.completed = function () {
13
+ return this.workTodo === 0 ? 0 : this.workDone / this.workTodo
14
+ }
15
+
16
+ Tracker.prototype.addWork = function (work) {
17
+ this.workTodo += work
18
+ this.emit('change', this.name, this.completed(), this)
19
+ }
20
+
21
+ Tracker.prototype.completeWork = function (work) {
22
+ this.workDone += work
23
+ if (this.workDone > this.workTodo) this.workDone = this.workTodo
24
+ this.emit('change', this.name, this.completed(), this)
25
+ }
26
+
27
+ Tracker.prototype.finish = function () {
28
+ this.workTodo = this.workDone = 1
29
+ this.emit('change', this.name, 1, this)
30
+ }
@@ -60,8 +60,7 @@
60
60
  ],
61
61
  "name": "asn1",
62
62
  "optionalDependencies": {},
63
- "readme": "node-asn1 is a library for encoding and decoding ASN.1 datatypes in pure JS.\nCurrently BER encoding is supported; at some point I'll likely have to do DER.\n\n## Usage\n\nMostly, if you're *actually* needing to read and write ASN.1, you probably don't\nneed this readme to explain what and why. If you have no idea what ASN.1 is,\nsee this: ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc\n\nThe source is pretty much self-explanatory, and has read/write methods for the\ncommon types out there.\n\n### Decoding\n\nThe following reads an ASN.1 sequence with a boolean.\n\n var Ber = require('asn1').Ber;\n\n var reader = new Ber.Reader(new Buffer([0x30, 0x03, 0x01, 0x01, 0xff]));\n\n reader.readSequence();\n console.log('Sequence len: ' + reader.length);\n if (reader.peek() === Ber.Boolean)\n console.log(reader.readBoolean());\n\n### Encoding\n\nThe following generates the same payload as above.\n\n var Ber = require('asn1').Ber;\n\n var writer = new Ber.Writer();\n\n writer.startSequence();\n writer.writeBoolean(true);\n writer.endSequence();\n\n console.log(writer.buffer);\n\n## Installation\n\n npm install asn1\n\n## License\n\nMIT.\n\n## Bugs\n\nSee <https://github.com/mcavage/node-asn1/issues>.\n",
64
- "readmeFilename": "README.md",
63
+ "readme": "ERROR: No README data found!",
65
64
  "repository": {
66
65
  "type": "git",
67
66
  "url": "git://github.com/mcavage/node-asn1.git"
@@ -10,7 +10,6 @@
10
10
  "_npmVersion": "3.3.8",
11
11
  "_phantomChildren": {},
12
12
  "_requiredBy": [
13
- "/dashdash",
14
13
  "/http-signature",
15
14
  "/sshpk"
16
15
  ],
@@ -79,8 +78,7 @@
79
78
  ],
80
79
  "name": "assert-plus",
81
80
  "optionalDependencies": {},
82
- "readme": "# assert-plus\n\nThis library is a super small wrapper over node's assert module that has two\nthings: (1) the ability to disable assertions with the environment variable\nNODE\\_NDEBUG, and (2) some API wrappers for argument testing. Like\n`assert.string(myArg, 'myArg')`. As a simple example, most of my code looks\nlike this:\n\n```javascript\n var assert = require('assert-plus');\n\n function fooAccount(options, callback) {\n assert.object(options, 'options');\n assert.number(options.id, 'options.id');\n assert.bool(options.isManager, 'options.isManager');\n assert.string(options.name, 'options.name');\n assert.arrayOfString(options.email, 'options.email');\n assert.func(callback, 'callback');\n\n // Do stuff\n callback(null, {});\n }\n```\n\n# API\n\nAll methods that *aren't* part of node's core assert API are simply assumed to\ntake an argument, and then a string 'name' that's not a message; `AssertionError`\nwill be thrown if the assertion fails with a message like:\n\n AssertionError: foo (string) is required\n at test (/home/mark/work/foo/foo.js:3:9)\n at Object.<anonymous> (/home/mark/work/foo/foo.js:15:1)\n at Module._compile (module.js:446:26)\n at Object..js (module.js:464:10)\n at Module.load (module.js:353:31)\n at Function._load (module.js:311:12)\n at Array.0 (module.js:484:10)\n at EventEmitter._tickCallback (node.js:190:38)\n\nfrom:\n\n```javascript\n function test(foo) {\n assert.string(foo, 'foo');\n }\n```\n\nThere you go. You can check that arrays are of a homogeneous type with `Arrayof$Type`:\n\n```javascript\n function test(foo) {\n assert.arrayOfString(foo, 'foo');\n }\n```\n\nYou can assert IFF an argument is not `undefined` (i.e., an optional arg):\n\n```javascript\n assert.optionalString(foo, 'foo');\n```\n\nLastly, you can opt-out of assertion checking altogether by setting the\nenvironment variable `NODE_NDEBUG=1`. This is pseudo-useful if you have\nlots of assertions, and don't want to pay `typeof ()` taxes to v8 in\nproduction. Be advised: The standard functions re-exported from `assert` are\nalso disabled in assert-plus if NDEBUG is specified. Using them directly from\nthe `assert` module avoids this behavior.\n\nThe complete list of APIs is:\n\n* assert.array\n* assert.bool\n* assert.buffer\n* assert.func\n* assert.number\n* assert.object\n* assert.string\n* assert.stream\n* assert.date\n* assert.regex\n* assert.uuid\n* assert.arrayOfArray\n* assert.arrayOfBool\n* assert.arrayOfBuffer\n* assert.arrayOfFunc\n* assert.arrayOfNumber\n* assert.arrayOfObject\n* assert.arrayOfString\n* assert.arrayOfStream\n* assert.arrayOfDate\n* assert.arrayOfUuid\n* assert.optionalArray\n* assert.optionalBool\n* assert.optionalBuffer\n* assert.optionalFunc\n* assert.optionalNumber\n* assert.optionalObject\n* assert.optionalString\n* assert.optionalStream\n* assert.optionalDate\n* assert.optionalUuid\n* assert.optionalArrayOfArray\n* assert.optionalArrayOfBool\n* assert.optionalArrayOfBuffer\n* assert.optionalArrayOfFunc\n* assert.optionalArrayOfNumber\n* assert.optionalArrayOfObject\n* assert.optionalArrayOfString\n* assert.optionalArrayOfStream\n* assert.optionalArrayOfDate\n* assert.optionalArrayOfUuid\n* assert.AssertionError\n* assert.fail\n* assert.ok\n* assert.equal\n* assert.notEqual\n* assert.deepEqual\n* assert.notDeepEqual\n* assert.strictEqual\n* assert.notStrictEqual\n* assert.throws\n* assert.doesNotThrow\n* assert.ifError\n\n# Installation\n\n npm install assert-plus\n\n## License\n\nThe MIT License (MIT)\nCopyright (c) 2012 Mark Cavage\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n## Bugs\n\nSee <https://github.com/mcavage/node-assert-plus/issues>.\n",
83
- "readmeFilename": "README.md",
81
+ "readme": "ERROR: No README data found!",
84
82
  "repository": {
85
83
  "type": "git",
86
84
  "url": "git+https://github.com/mcavage/node-assert-plus.git"
@@ -1,5 +1,5 @@
1
1
  {
2
- "_from": "async@^1.4.0",
2
+ "_from": "async@^1.5.2",
3
3
  "_id": "async@1.5.2",
4
4
  "_location": "/async",
5
5
  "_nodeVersion": "4.2.3",
@@ -1,3 +1,4 @@
1
1
  test
2
- coverage
3
2
  examples
3
+ example.js
4
+ browser
@@ -6,6 +6,8 @@ aws4
6
6
  A small utility to sign vanilla node.js http(s) request options using Amazon's
7
7
  [AWS Signature Version 4](http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html).
8
8
 
9
+ Can also be used [in the browser](./browser).
10
+
9
11
  This signature is supported by nearly all Amazon services, including
10
12
  [S3](http://docs.aws.amazon.com/AmazonS3/latest/API/),
11
13
  [EC2](http://docs.aws.amazon.com/AWSEC2/latest/APIReference/),
@@ -497,6 +499,8 @@ With [npm](http://npmjs.org/) do:
497
499
  npm install aws4
498
500
  ```
499
501
 
502
+ Can also be used [in the browser](./browser).
503
+
500
504
  Thanks
501
505
  ------
502
506
 
@@ -43,8 +43,13 @@ function RequestSigner(request, credentials) {
43
43
  if (!request.method && request.body)
44
44
  request.method = 'POST'
45
45
 
46
- if (!headers.Host && !headers.host)
46
+ if (!headers.Host && !headers.host) {
47
47
  headers.Host = request.hostname || request.host || this.createHost()
48
+
49
+ // If a port is specified explicitly, use it as is
50
+ if (request.port)
51
+ headers.Host += ':' + request.port
52
+ }
48
53
  if (!request.hostname && !request.host)
49
54
  request.hostname = headers.Host || headers.host
50
55
  }
@@ -210,8 +215,7 @@ RequestSigner.prototype.canonicalString = function() {
210
215
  }
211
216
  if (pathStr !== '/') {
212
217
  if (normalizePath) pathStr = pathStr.replace(/\/{2,}/g, '/')
213
- if (pathStr[0] === '/') pathStr = pathStr.slice(1)
214
- pathStr = '/' + pathStr.split('/').reduce(function(path, piece) {
218
+ pathStr = pathStr.split('/').reduce(function(path, piece) {
215
219
  if (normalizePath && piece === '..') {
216
220
  path.pop()
217
221
  } else if (!normalizePath || piece !== '.') {
@@ -220,6 +224,7 @@ RequestSigner.prototype.canonicalString = function() {
220
224
  }
221
225
  return path
222
226
  }, []).join('/')
227
+ if (pathStr[0] !== '/') pathStr = '/' + pathStr
223
228
  if (decodeSlashesInPath) pathStr = pathStr.replace(/%2F/g, '/')
224
229
  }
225
230
 
@@ -1 +1,4 @@
1
1
  /node_modules
2
+ .nyc_output
3
+ nyc_output
4
+ coverage
@@ -1,8 +1,7 @@
1
+ sudo: false
1
2
  language: node_js
2
3
  node_js:
3
- - '0.8'
4
4
  - '0.10'
5
5
  - '0.12'
6
- - 'iojs'
7
- before_install:
8
- - npm install -g npm@latest
6
+ - '4'
7
+ - '5'