fsevents 1.0.6 → 1.0.7
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.
- package/node_modules/are-we-there-yet/LICENSE +5 -0
- package/node_modules/are-we-there-yet/README.md +2 -1
- package/node_modules/are-we-there-yet/README.md~ +183 -0
- package/node_modules/are-we-there-yet/package.json +10 -9
- package/node_modules/async/README.md +14 -10
- package/node_modules/async/dist/async.js +22 -18
- package/node_modules/async/dist/async.min.js +1 -1
- package/node_modules/async/lib/async.js +22 -18
- package/node_modules/async/package.json +11 -10
- package/node_modules/core-util-is/package.json +2 -1
- package/node_modules/dashdash/README.md +6 -3
- package/node_modules/dashdash/lib/dashdash.js +10 -1
- package/node_modules/dashdash/package.json +9 -8
- package/node_modules/escape-string-regexp/index.js +1 -1
- package/node_modules/escape-string-regexp/package.json +17 -15
- package/node_modules/escape-string-regexp/readme.md +4 -4
- package/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md +9 -0
- package/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js +42 -30
- package/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +9 -9
- package/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js +28 -0
- package/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/package.json +11 -11
- package/node_modules/graceful-fs/package.json +2 -3
- package/node_modules/isarray/package.json +2 -1
- package/node_modules/mime-db/HISTORY.md +32 -0
- package/node_modules/mime-db/README.md +1 -1
- package/node_modules/mime-db/db.json +78 -0
- package/node_modules/mime-db/package.json +15 -14
- package/node_modules/mime-types/HISTORY.md +12 -0
- package/node_modules/mime-types/package.json +11 -10
- package/node_modules/node-pre-gyp/CHANGELOG.md +8 -0
- package/node_modules/node-pre-gyp/lib/util/abi_crosswalk.json +32 -0
- package/node_modules/node-pre-gyp/package.json +8 -8
- package/node_modules/{bl/node_modules/readable-stream/node_modules/process-nextick-args → process-nextick-args}/.travis.yml +6 -1
- package/node_modules/{bl/node_modules/readable-stream/node_modules/process-nextick-args → process-nextick-args}/index.js +8 -1
- package/node_modules/{bl/node_modules/readable-stream/node_modules/process-nextick-args → process-nextick-args}/package.json +13 -12
- package/node_modules/rc/lib/utils.js +1 -1
- package/node_modules/rc/package.json +11 -10
- package/node_modules/readable-stream/README.md +27 -6
- package/node_modules/{bl/node_modules/readable-stream → readable-stream}/doc/stream.markdown +608 -574
- package/node_modules/readable-stream/lib/_stream_duplex.js +18 -25
- package/node_modules/readable-stream/lib/_stream_passthrough.js +2 -21
- package/node_modules/readable-stream/lib/_stream_readable.js +117 -93
- package/node_modules/readable-stream/lib/_stream_transform.js +15 -27
- package/node_modules/readable-stream/lib/_stream_writable.js +140 -88
- package/node_modules/readable-stream/package.json +33 -25
- package/node_modules/readable-stream/readable.js +6 -1
- package/node_modules/rimraf/README.md +58 -0
- package/node_modules/rimraf/node_modules/glob/README.md +27 -45
- package/node_modules/rimraf/node_modules/glob/common.js +7 -26
- package/node_modules/rimraf/node_modules/glob/node_modules/inherits/package.json +1 -1
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md +9 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js +42 -30
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +9 -9
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js +28 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +11 -11
- package/node_modules/rimraf/node_modules/glob/package.json +11 -10
- package/node_modules/rimraf/package.json +12 -11
- package/node_modules/rimraf/rimraf.js +7 -5
- package/node_modules/sshpk/bin/sshpk-conv +1 -1
- package/node_modules/sshpk/lib/dhe.js +1 -2
- package/node_modules/sshpk/lib/ssh-buffer.js +2 -1
- package/node_modules/sshpk/package.json +13 -11
- package/node_modules/string_decoder/package.json +2 -1
- package/node_modules/tar-pack/index.js +1 -2
- package/node_modules/tar-pack/node_modules/rimraf/LICENSE +12 -20
- package/node_modules/tar-pack/node_modules/rimraf/README.md +17 -4
- package/node_modules/tar-pack/node_modules/rimraf/bin.js +11 -4
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/README.md +359 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/common.js +226 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/glob.js +752 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/.eslintrc +17 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/LICENSE +15 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/README.md +37 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/inflight.js +44 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy/LICENSE +15 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy/README.md +36 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy/package.json +58 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy/test/basic.js +51 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy/wrappy.js +33 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/package.json +67 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/test.js +97 -0
- package/node_modules/{bl/node_modules/readable-stream → tar-pack/node_modules/rimraf/node_modules/glob}/node_modules/inherits/package.json +3 -3
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/README.md +216 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/minimatch.js +912 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore +3 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md +122 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js +8 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js +191 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore +2 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml +3 -0
- package/node_modules/tar-pack/node_modules/{readable-stream/node_modules/isarray/README.md → rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md} +0 -33
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile +6 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md +89 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js +5 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js +50 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +79 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js +84 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml +4 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE +18 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown +62 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js +6 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js +13 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json +90 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js +39 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +81 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/package.json +66 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/README.md +51 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy/LICENSE +15 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy/README.md +36 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy/package.json +58 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy/test/basic.js +51 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy/wrappy.js +33 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/once.js +21 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/package.json +70 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/index.js +20 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/package.json +78 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/readme.md +51 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/package.json +79 -0
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/sync.js +460 -0
- package/node_modules/tar-pack/node_modules/rimraf/package.json +28 -40
- package/node_modules/tar-pack/node_modules/rimraf/rimraf.js +138 -53
- package/node_modules/tar-pack/package.json +21 -11
- package/node_modules/tunnel-agent/index.js +2 -0
- package/node_modules/tunnel-agent/package.json +10 -9
- package/node_modules/{bl/node_modules/readable-stream/node_modules/util-deprecate → util-deprecate}/package.json +3 -2
- package/node_modules/verror/package.json +3 -2
- package/package.json +2 -2
- package/CHANGELOG.md +0 -16
- package/node_modules/bl/node_modules/readable-stream/.npmignore +0 -5
- package/node_modules/bl/node_modules/readable-stream/LICENSE +0 -18
- package/node_modules/bl/node_modules/readable-stream/README.md +0 -36
- package/node_modules/bl/node_modules/readable-stream/duplex.js +0 -1
- package/node_modules/bl/node_modules/readable-stream/lib/_stream_duplex.js +0 -82
- package/node_modules/bl/node_modules/readable-stream/lib/_stream_passthrough.js +0 -27
- package/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js +0 -973
- package/node_modules/bl/node_modules/readable-stream/lib/_stream_transform.js +0 -197
- package/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js +0 -527
- package/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/LICENSE +0 -19
- package/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/README.md +0 -3
- package/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/float.patch +0 -604
- package/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/lib/util.js +0 -107
- package/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json +0 -67
- package/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/test.js +0 -68
- package/node_modules/bl/node_modules/readable-stream/node_modules/isarray/README.md +0 -54
- package/node_modules/bl/node_modules/readable-stream/node_modules/isarray/build/build.js +0 -209
- package/node_modules/bl/node_modules/readable-stream/node_modules/isarray/component.json +0 -19
- package/node_modules/bl/node_modules/readable-stream/node_modules/isarray/index.js +0 -3
- package/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json +0 -59
- package/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/.npmignore +0 -2
- package/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/LICENSE +0 -20
- package/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/README.md +0 -7
- package/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/index.js +0 -221
- package/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json +0 -60
- package/node_modules/bl/node_modules/readable-stream/package.json +0 -82
- package/node_modules/bl/node_modules/readable-stream/passthrough.js +0 -1
- package/node_modules/bl/node_modules/readable-stream/readable.js +0 -12
- package/node_modules/bl/node_modules/readable-stream/transform.js +0 -1
- package/node_modules/bl/node_modules/readable-stream/writable.js +0 -1
- package/node_modules/node-pre-gyp/LICENSE +0 -27
- package/node_modules/readable-stream/float.patch +0 -923
- package/node_modules/tar-pack/node_modules/readable-stream/.npmignore +0 -5
- package/node_modules/tar-pack/node_modules/readable-stream/LICENSE +0 -18
- package/node_modules/tar-pack/node_modules/readable-stream/README.md +0 -15
- package/node_modules/tar-pack/node_modules/readable-stream/duplex.js +0 -1
- package/node_modules/tar-pack/node_modules/readable-stream/lib/_stream_duplex.js +0 -89
- package/node_modules/tar-pack/node_modules/readable-stream/lib/_stream_passthrough.js +0 -46
- package/node_modules/tar-pack/node_modules/readable-stream/lib/_stream_readable.js +0 -982
- package/node_modules/tar-pack/node_modules/readable-stream/lib/_stream_transform.js +0 -210
- package/node_modules/tar-pack/node_modules/readable-stream/lib/_stream_writable.js +0 -386
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/core-util-is/LICENSE +0 -19
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/core-util-is/README.md +0 -3
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/core-util-is/float.patch +0 -604
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/core-util-is/lib/util.js +0 -107
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/core-util-is/package.json +0 -67
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/core-util-is/test.js +0 -68
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/inherits/LICENSE +0 -16
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/inherits/README.md +0 -42
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/inherits/inherits.js +0 -1
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/inherits/inherits_browser.js +0 -23
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/inherits/package.json +0 -58
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/inherits/test.js +0 -25
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/isarray/build/build.js +0 -209
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/isarray/component.json +0 -19
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/isarray/index.js +0 -3
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/isarray/package.json +0 -59
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/string_decoder/.npmignore +0 -2
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/string_decoder/LICENSE +0 -20
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/string_decoder/README.md +0 -7
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/string_decoder/index.js +0 -221
- package/node_modules/tar-pack/node_modules/readable-stream/node_modules/string_decoder/package.json +0 -60
- package/node_modules/tar-pack/node_modules/readable-stream/package.json +0 -76
- package/node_modules/tar-pack/node_modules/readable-stream/passthrough.js +0 -1
- package/node_modules/tar-pack/node_modules/readable-stream/readable.js +0 -8
- package/node_modules/tar-pack/node_modules/readable-stream/transform.js +0 -1
- package/node_modules/tar-pack/node_modules/readable-stream/writable.js +0 -1
- package/node_modules/tar-pack/node_modules/rimraf/AUTHORS +0 -6
- package/node_modules/tar-pack/node_modules/rimraf/test/run.sh +0 -16
- package/node_modules/tar-pack/node_modules/rimraf/test/setup.sh +0 -47
- package/node_modules/tar-pack/node_modules/rimraf/test/test-async.js +0 -5
- package/node_modules/tar-pack/node_modules/rimraf/test/test-sync.js +0 -3
- /package/node_modules/{bl/node_modules/readable-stream/node_modules/process-nextick-args → process-nextick-args}/license.md +0 -0
- /package/node_modules/{bl/node_modules/readable-stream/node_modules/process-nextick-args → process-nextick-args}/readme.md +0 -0
- /package/node_modules/{bl/node_modules/readable-stream/node_modules/process-nextick-args → process-nextick-args}/test.js +0 -0
- /package/node_modules/{bl/node_modules/readable-stream → readable-stream}/.travis.yml +0 -0
- /package/node_modules/{bl/node_modules/readable-stream → readable-stream}/.zuul.yml +0 -0
- /package/node_modules/{bl/node_modules/readable-stream → readable-stream}/doc/wg-meetings/2015-01-30.md +0 -0
- /package/node_modules/{bl/node_modules/readable-stream → tar-pack/node_modules/rimraf/node_modules/glob}/node_modules/inherits/LICENSE +0 -0
- /package/node_modules/{bl/node_modules/readable-stream → tar-pack/node_modules/rimraf/node_modules/glob}/node_modules/inherits/README.md +0 -0
- /package/node_modules/{bl/node_modules/readable-stream → tar-pack/node_modules/rimraf/node_modules/glob}/node_modules/inherits/inherits.js +0 -0
- /package/node_modules/{bl/node_modules/readable-stream → tar-pack/node_modules/rimraf/node_modules/glob}/node_modules/inherits/inherits_browser.js +0 -0
- /package/node_modules/{bl/node_modules/readable-stream → tar-pack/node_modules/rimraf/node_modules/glob}/node_modules/inherits/test.js +0 -0
- /package/node_modules/{bl/node_modules/readable-stream/node_modules/util-deprecate → util-deprecate}/History.md +0 -0
- /package/node_modules/{bl/node_modules/readable-stream/node_modules/util-deprecate → util-deprecate}/LICENSE +0 -0
- /package/node_modules/{bl/node_modules/readable-stream/node_modules/util-deprecate → util-deprecate}/README.md +0 -0
- /package/node_modules/{bl/node_modules/readable-stream/node_modules/util-deprecate → util-deprecate}/browser.js +0 -0
- /package/node_modules/{bl/node_modules/readable-stream/node_modules/util-deprecate → util-deprecate}/node.js +0 -0
@@ -0,0 +1,5 @@
|
|
1
|
+
Copyright (c) 2015, Rebecca Turner
|
2
|
+
|
3
|
+
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
|
4
|
+
|
5
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
@@ -128,7 +128,8 @@ Tracker
|
|
128
128
|
events. Defaults to undefined.
|
129
129
|
* **todo** *(optional)* The amount of work todo (a number). Defaults to 0.
|
130
130
|
|
131
|
-
Ordinarily these are constructed as a part of a tracker group (via
|
131
|
+
Ordinarily these are constructed as a part of a tracker group (via
|
132
|
+
`newItem`).
|
132
133
|
|
133
134
|
* var completed = tracker.completed()
|
134
135
|
|
@@ -0,0 +1,183 @@
|
|
1
|
+
are-we-there-yet
|
2
|
+
----------------
|
3
|
+
|
4
|
+
Track complex hiearchies of asynchronous task completion statuses. This is
|
5
|
+
intended to give you a way of recording and reporting the progress of the big
|
6
|
+
recursive fan-out and gather type workflows that are so common in async.
|
7
|
+
|
8
|
+
What you do with this completion data is up to you, but the most common use case is to
|
9
|
+
feed it to one of the many progress bar modules.
|
10
|
+
|
11
|
+
Most progress bar modules include a rudamentary version of this, but my
|
12
|
+
needs were more complex.
|
13
|
+
|
14
|
+
Usage
|
15
|
+
=====
|
16
|
+
|
17
|
+
```javascript
|
18
|
+
var TrackerGroup = require("are-we-there-yet").TrackerGroup
|
19
|
+
|
20
|
+
var top = new TrackerGroup("program")
|
21
|
+
|
22
|
+
var single = top.newItem("one thing", 100)
|
23
|
+
single.completeWork(20)
|
24
|
+
|
25
|
+
console.log(top.completed()) // 0.2
|
26
|
+
|
27
|
+
fs.stat("file", function(er, stat) {
|
28
|
+
if (er) throw er
|
29
|
+
var stream = top.newStream("file", stat.size)
|
30
|
+
console.log(top.completed()) // now 0.1 as single is 50% of the job and is 20% complete
|
31
|
+
// and 50% * 20% == 10%
|
32
|
+
fs.createReadStream("file").pipe(stream).on("data", function (chunk) {
|
33
|
+
// do stuff with chunk
|
34
|
+
})
|
35
|
+
top.on("change", function (name) {
|
36
|
+
// called each time a chunk is read from "file"
|
37
|
+
// top.completed() will start at 0.1 and fill up to 0.6 as the file is read
|
38
|
+
})
|
39
|
+
})
|
40
|
+
```
|
41
|
+
|
42
|
+
Shared Methods
|
43
|
+
==============
|
44
|
+
|
45
|
+
All tracker objects described below have the following methods, they, along
|
46
|
+
with the event comprise the interface for consumers of tracker objects.
|
47
|
+
|
48
|
+
* var completed = tracker.completed()
|
49
|
+
|
50
|
+
Returns the ratio of completed work to work to be done. Range of 0 to 1.
|
51
|
+
|
52
|
+
* tracker.finish()
|
53
|
+
|
54
|
+
Marks the tracker as completed. With a TrackerGroup this marks all of its
|
55
|
+
components as completed.
|
56
|
+
|
57
|
+
Marks all of the components of this tracker as finished, which in turn means
|
58
|
+
that `tracker.completed()` for this will now be 1.
|
59
|
+
|
60
|
+
This will result in one or more `change` events being emitted.
|
61
|
+
|
62
|
+
Events
|
63
|
+
======
|
64
|
+
|
65
|
+
All tracker objects emit `change` events with an argument of the name of the
|
66
|
+
thing changing.
|
67
|
+
|
68
|
+
TrackerGroup
|
69
|
+
============
|
70
|
+
|
71
|
+
* var tracker = new TrackerGroup(**name**)
|
72
|
+
|
73
|
+
* **name** *(optional)* - The name of this tracker group, used in change
|
74
|
+
notifications if the component updating didn't have a name. Defaults to undefined.
|
75
|
+
|
76
|
+
Creates a new empty tracker aggregation group. These are trackers whose
|
77
|
+
completion status is determined by the completion status of other trackers.
|
78
|
+
|
79
|
+
* tracker.addUnit(**otherTracker**, **weight**)
|
80
|
+
|
81
|
+
* **otherTracker** - Any of the other are-we-there-yet tracker objects
|
82
|
+
* **weight** *(optional)* - The weight to give the tracker, defaults to 1.
|
83
|
+
|
84
|
+
Adds the **otherTracker** to this aggregation group. The weight determines
|
85
|
+
how long you expect this tracker to take to complete in proportion to other
|
86
|
+
units. So for instance, if you add one tracker with a weight of 1 and
|
87
|
+
another with a weight of 2, you're saying the second will take twice as long
|
88
|
+
to complete as the first. As such, the first will account for 33% of the
|
89
|
+
completion of this tracker and the second will account for the other 67%.
|
90
|
+
|
91
|
+
Returns **otherTracker**.
|
92
|
+
|
93
|
+
* var subGroup = tracker.newGroup(**name**, **weight**)
|
94
|
+
|
95
|
+
The above is exactly equivalent to:
|
96
|
+
|
97
|
+
```javascript
|
98
|
+
var subGroup = tracker.addUnit(new TrackerGroup(name), weight)
|
99
|
+
```
|
100
|
+
|
101
|
+
* var subItem = tracker.newItem(**name**, **todo**, **weight**)
|
102
|
+
|
103
|
+
The above is exactly equivalent to:
|
104
|
+
|
105
|
+
```javascript
|
106
|
+
var subItem = tracker.addUnit(new Tracker(name, todo), weight)
|
107
|
+
```
|
108
|
+
|
109
|
+
* var subStream = tracker.newStream(**name**, **todo**, **weight**)
|
110
|
+
|
111
|
+
The above is exactly equivalent to:
|
112
|
+
|
113
|
+
```javascript
|
114
|
+
var subStream = tracker.addUnit(new TrackerStream(name, todo), weight)
|
115
|
+
```
|
116
|
+
|
117
|
+
* console.log( tracker.debug() )
|
118
|
+
|
119
|
+
Returns a tree showing the completion of this tracker group and all of its
|
120
|
+
children, including recursively entering all of the children.
|
121
|
+
|
122
|
+
Tracker
|
123
|
+
=======
|
124
|
+
|
125
|
+
* var tracker = new Tracker(**name**, **todo**)
|
126
|
+
|
127
|
+
* **name** *(optional)* The name of this counter to report in change
|
128
|
+
events. Defaults to undefined.
|
129
|
+
* **todo** *(optional)* The amount of work todo (a number). Defaults to 0.
|
130
|
+
|
131
|
+
Ordinarily these are constructed as a part of a tracker group (via `newItem`) but they c
|
132
|
+
|
133
|
+
* var completed = tracker.completed()
|
134
|
+
|
135
|
+
Returns the ratio of completed work to work to be done. Range of 0 to 1. If
|
136
|
+
total work to be done is 0 then it will return 0.
|
137
|
+
|
138
|
+
* tracker.addWork(**todo**)
|
139
|
+
|
140
|
+
* **todo** A number to add to the amount of work to be done.
|
141
|
+
|
142
|
+
Increases the amount of work to be done, thus decreasing the completion
|
143
|
+
percentage. Triggers a `change` event.
|
144
|
+
|
145
|
+
* tracker.completeWork(**completed**)
|
146
|
+
|
147
|
+
* **completed** A number to add to the work complete
|
148
|
+
|
149
|
+
Increase the amount of work complete, thus increasing the completion percentage.
|
150
|
+
Will never increase the work completed past the amount of work todo. That is,
|
151
|
+
percentages > 100% are not allowed. Triggers a `change` event.
|
152
|
+
|
153
|
+
* tracker.finish()
|
154
|
+
|
155
|
+
Marks this tracker as finished, tracker.completed() will now be 1. Triggers
|
156
|
+
a `change` event.
|
157
|
+
|
158
|
+
TrackerStream
|
159
|
+
=============
|
160
|
+
|
161
|
+
* var tracker = new TrackerStream(**name**, **size**, **options**)
|
162
|
+
|
163
|
+
* **name** *(optional)* The name of this counter to report in change
|
164
|
+
events. Defaults to undefined.
|
165
|
+
* **size** *(optional)* The number of bytes being sent through this stream.
|
166
|
+
* **options** *(optional)* A hash of stream options
|
167
|
+
|
168
|
+
The tracker stream object is a pass through stream that updates an internal
|
169
|
+
tracker object each time a block passes through. It's intended to track
|
170
|
+
downloads, file extraction and other related activities. You use it by piping
|
171
|
+
your data source into it and then using it as your data source.
|
172
|
+
|
173
|
+
If your data has a length attribute then that's used as the amount of work
|
174
|
+
completed when the chunk is passed through. If it does not (eg, object
|
175
|
+
streams) then each chunk counts as completing 1 unit of work, so your size
|
176
|
+
should be the total number of objects being streamed.
|
177
|
+
|
178
|
+
* tracker.addWork(**todo**)
|
179
|
+
|
180
|
+
* **todo** Increase the expected overall size by **todo** bytes.
|
181
|
+
|
182
|
+
Increases the amount of work to be done, thus decreasing the completion
|
183
|
+
percentage. Triggers a `change` event.
|
@@ -1,18 +1,19 @@
|
|
1
1
|
{
|
2
2
|
"_from": "are-we-there-yet@~1.0.0",
|
3
|
-
"_id": "are-we-there-yet@1.0.
|
3
|
+
"_id": "are-we-there-yet@1.0.5",
|
4
4
|
"_location": "/are-we-there-yet",
|
5
|
+
"_nodeVersion": "4.2.2",
|
5
6
|
"_npmUser": {
|
6
7
|
"email": "me@re-becca.org",
|
7
8
|
"name": "iarna"
|
8
9
|
},
|
9
|
-
"_npmVersion": "
|
10
|
+
"_npmVersion": "3.5.2",
|
10
11
|
"_phantomChildren": {},
|
11
12
|
"_requiredBy": [
|
12
13
|
"/npmlog"
|
13
14
|
],
|
14
|
-
"_resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.0.
|
15
|
-
"_shasum": "
|
15
|
+
"_resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.0.5.tgz",
|
16
|
+
"_shasum": "239f26706da902a2bffb72c33de66fdfd3798ac5",
|
16
17
|
"author": {
|
17
18
|
"name": "Rebecca Turner",
|
18
19
|
"url": "http://re-becca.org"
|
@@ -22,7 +23,7 @@
|
|
22
23
|
},
|
23
24
|
"dependencies": {
|
24
25
|
"delegates": "^0.1.0",
|
25
|
-
"readable-stream": "^1.1.13"
|
26
|
+
"readable-stream": "^2.0.0 || ^1.1.13"
|
26
27
|
},
|
27
28
|
"description": "Keep track of the overall completion of many dispirate processes",
|
28
29
|
"devDependencies": {
|
@@ -30,10 +31,10 @@
|
|
30
31
|
},
|
31
32
|
"directories": {},
|
32
33
|
"dist": {
|
33
|
-
"shasum": "
|
34
|
-
"tarball": "http://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.0.
|
34
|
+
"shasum": "239f26706da902a2bffb72c33de66fdfd3798ac5",
|
35
|
+
"tarball": "http://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.0.5.tgz"
|
35
36
|
},
|
36
|
-
"gitHead": "
|
37
|
+
"gitHead": "abaff79ae17e9397eae19d29d2d75778d18aab3a",
|
37
38
|
"homepage": "https://github.com/iarna/are-we-there-yet",
|
38
39
|
"license": "ISC",
|
39
40
|
"main": "index.js",
|
@@ -53,5 +54,5 @@
|
|
53
54
|
"scripts": {
|
54
55
|
"test": "tap test/*.js"
|
55
56
|
},
|
56
|
-
"version": "1.0.
|
57
|
+
"version": "1.0.5"
|
57
58
|
}
|
@@ -627,9 +627,9 @@ __Arguments__
|
|
627
627
|
* `iterator(item, callback)` - A truth test to apply to each item in the array
|
628
628
|
in parallel. The iterator is passed a `callback(truthValue)` which must be
|
629
629
|
called with a boolean argument once it has completed.
|
630
|
-
* `callback(result)` - *Optional* A callback which is called
|
631
|
-
functions have finished. Result will be
|
632
|
-
the values of the async tests.
|
630
|
+
* `callback(result)` - *Optional* A callback which is called as soon as any iterator returns
|
631
|
+
`false`, or after all the iterator functions have finished. Result will be
|
632
|
+
either `true` or `false` depending on the values of the async tests.
|
633
633
|
|
634
634
|
**Note: the callbacks do not take an error as their first argument.**
|
635
635
|
|
@@ -773,7 +773,7 @@ __Arguments__
|
|
773
773
|
a `callback(err, result)` which it must call on completion with an error `err`
|
774
774
|
(which can be `null`) and an optional `result` value.
|
775
775
|
* `callback(err, results)` - An optional callback to run once all the functions
|
776
|
-
have completed. This function gets a results array (or object) containing all
|
776
|
+
have completed successfully. This function gets a results array (or object) containing all
|
777
777
|
the result arguments passed to the task callbacks.
|
778
778
|
|
779
779
|
__Example__
|
@@ -834,8 +834,9 @@ __Arguments__
|
|
834
834
|
* `fn(callback)` - A function which is called each time `test` passes. The function is
|
835
835
|
passed a `callback(err)`, which must be called once it has completed with an
|
836
836
|
optional `err` argument.
|
837
|
-
* `callback(err)` - A callback which is called after the test
|
838
|
-
execution of `fn` has stopped.
|
837
|
+
* `callback(err, [results])` - A callback which is called after the test
|
838
|
+
function has failed and repeated execution of `fn` has stopped. `callback`
|
839
|
+
will be passed an error and any arguments passed to the final `fn`'s callback.
|
839
840
|
|
840
841
|
__Example__
|
841
842
|
|
@@ -846,10 +847,12 @@ async.whilst(
|
|
846
847
|
function () { return count < 5; },
|
847
848
|
function (callback) {
|
848
849
|
count++;
|
849
|
-
setTimeout(
|
850
|
+
setTimeout(function () {
|
851
|
+
callback(null, count);
|
852
|
+
}, 1000);
|
850
853
|
},
|
851
|
-
function (err) {
|
852
|
-
// 5 seconds have passed
|
854
|
+
function (err, n) {
|
855
|
+
// 5 seconds have passed, n = 5
|
853
856
|
}
|
854
857
|
);
|
855
858
|
```
|
@@ -870,7 +873,8 @@ the order of operations, the arguments `test` and `fn` are switched.
|
|
870
873
|
### until(test, fn, callback)
|
871
874
|
|
872
875
|
Repeatedly call `fn` until `test` returns `true`. Calls `callback` when stopped,
|
873
|
-
or an error occurs.
|
876
|
+
or an error occurs. `callback` will be passed an error and any arguments passed
|
877
|
+
to the final `fn`'s callback.
|
874
878
|
|
875
879
|
The inverse of [`whilst`](#whilst).
|
876
880
|
|
@@ -510,7 +510,7 @@
|
|
510
510
|
};
|
511
511
|
|
512
512
|
async.auto = function (tasks, concurrency, callback) {
|
513
|
-
if (
|
513
|
+
if (typeof arguments[1] === 'function') {
|
514
514
|
// concurrency is optional, shift the args.
|
515
515
|
callback = concurrency;
|
516
516
|
concurrency = null;
|
@@ -528,6 +528,8 @@
|
|
528
528
|
var results = {};
|
529
529
|
var runningTasks = 0;
|
530
530
|
|
531
|
+
var hasError = false;
|
532
|
+
|
531
533
|
var listeners = [];
|
532
534
|
function addListener(fn) {
|
533
535
|
listeners.unshift(fn);
|
@@ -550,6 +552,7 @@
|
|
550
552
|
});
|
551
553
|
|
552
554
|
_arrayEach(keys, function (k) {
|
555
|
+
if (hasError) return;
|
553
556
|
var task = _isArray(tasks[k]) ? tasks[k]: [tasks[k]];
|
554
557
|
var taskCallback = _restParam(function(err, args) {
|
555
558
|
runningTasks--;
|
@@ -562,6 +565,8 @@
|
|
562
565
|
safeResults[rkey] = val;
|
563
566
|
});
|
564
567
|
safeResults[k] = args;
|
568
|
+
hasError = true;
|
569
|
+
|
565
570
|
callback(err, safeResults);
|
566
571
|
}
|
567
572
|
else {
|
@@ -781,7 +786,7 @@
|
|
781
786
|
} else if (test.apply(this, args)) {
|
782
787
|
iterator(next);
|
783
788
|
} else {
|
784
|
-
callback(null);
|
789
|
+
callback.apply(null, [null].concat(args));
|
785
790
|
}
|
786
791
|
});
|
787
792
|
iterator(next);
|
@@ -929,24 +934,23 @@
|
|
929
934
|
_insert(q, data, true, callback);
|
930
935
|
},
|
931
936
|
process: function () {
|
932
|
-
|
933
|
-
while(workers < q.concurrency && q.tasks.length){
|
934
|
-
var tasks = q.payload ?
|
935
|
-
q.tasks.splice(0, q.payload) :
|
936
|
-
q.tasks.splice(0, q.tasks.length);
|
937
|
-
|
938
|
-
var data = _map(tasks, function (task) {
|
939
|
-
return task.data;
|
940
|
-
});
|
937
|
+
while(!q.paused && workers < q.concurrency && q.tasks.length){
|
941
938
|
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
|
939
|
+
var tasks = q.payload ?
|
940
|
+
q.tasks.splice(0, q.payload) :
|
941
|
+
q.tasks.splice(0, q.tasks.length);
|
942
|
+
|
943
|
+
var data = _map(tasks, function (task) {
|
944
|
+
return task.data;
|
945
|
+
});
|
946
|
+
|
947
|
+
if (q.tasks.length === 0) {
|
948
|
+
q.empty();
|
949
949
|
}
|
950
|
+
workers += 1;
|
951
|
+
workersList.push(tasks[0]);
|
952
|
+
var cb = only_once(_next(q, tasks));
|
953
|
+
worker(data, cb);
|
950
954
|
}
|
951
955
|
},
|
952
956
|
length: function () {
|
@@ -1,2 +1,2 @@
|
|
1
|
-
!function(){function n(){}function t(n){return n}function e(n){return!!n}function r(n){return!n}function u(n){return function(){if(null===n)throw new Error("Callback was already called.");n.apply(this,arguments),n=null}}function i(n){return function(){null!==n&&(n.apply(this,arguments),n=null)}}function o(n){return M(n)||"number"==typeof n.length&&n.length>=0&&n.length%1===0}function c(n,t){for(var e=-1,r=n.length;++e<r;)t(n[e],e,n)}function a(n,t){for(var e=-1,r=n.length,u=Array(r);++e<r;)u[e]=t(n[e],e,n);return u}function f(n){return a(Array(n),function(n,t){return t})}function l(n,t,e){return c(n,function(n,r,u){e=t(e,n,r,u)}),e}function s(n,t){c(W(n),function(e){t(n[e],e)})}function p(n,t){for(var e=0;e<n.length;e++)if(n[e]===t)return e;return-1}function h(n){var t,e,r=-1;return o(n)?(t=n.length,function(){return r++,t>r?r:null}):(e=W(n),t=e.length,function(){return r++,t>r?e[r]:null})}function m(n,t){return t=null==t?n.length-1:+t,function(){for(var e=Math.max(arguments.length-t,0),r=Array(e),u=0;e>u;u++)r[u]=arguments[u+t];switch(t){case 0:return n.call(this,r);case 1:return n.call(this,arguments[0],r)}}}function y(n){return function(t,e,r){return n(t,r)}}function v(t){return function(e,r,o){o=i(o||n),e=e||[];var c=h(e);if(0>=t)return o(null);var a=!1,f=0,l=!1;!function s(){if(a&&0>=f)return o(null);for(;t>f&&!l;){var n=c();if(null===n)return a=!0,void(0>=f&&o(null));f+=1,r(e[n],n,u(function(n){f-=1,n?(o(n),l=!0):s()}))}}()}}function d(n){return function(t,e,r){return n(C.eachOf,t,e,r)}}function g(n){return function(t,e,r,u){return n(v(e),t,r,u)}}function k(n){return function(t,e,r){return n(C.eachOfSeries,t,e,r)}}function b(t,e,r,u){u=i(u||n),e=e||[];var c=o(e)?[]:{};t(e,function(n,t,e){r(n,function(n,r){c[t]=r,e(n)})},function(n){u(n,c)})}function w(n,t,e,r){var u=[];n(t,function(n,t,r){e(n,function(e){e&&u.push({index:t,value:n}),r()})},function(){r(a(u.sort(function(n,t){return n.index-t.index}),function(n){return n.value}))})}function O(n,t,e,r){w(n,t,function(n,t){e(n,function(n){t(!n)})},r)}function S(n,t,e){return function(r,u,i,o){function c(){o&&o(e(!1,void 0))}function a(n,r,u){return o?void i(n,function(r){o&&t(r)&&(o(e(!0,n)),o=i=!1),u()}):u()}arguments.length>3?n(r,u,a,c):(o=i,i=u,n(r,a,c))}}function E(n,t){return t}function L(t,e,r){r=r||n;var u=o(e)?[]:{};t(e,function(n,t,e){n(m(function(n,r){r.length<=1&&(r=r[0]),u[t]=r,e(n)}))},function(n){r(n,u)})}function I(n,t,e,r){var u=[];n(t,function(n,t,r){e(n,function(n,t){u=u.concat(t||[]),r(n)})},function(n){r(n,u)})}function x(t,e,r){function i(t,e,r,u){if(null!=u&&"function"!=typeof u)throw new Error("task callback must be a function");return t.started=!0,M(e)||(e=[e]),0===e.length&&t.idle()?C.setImmediate(function(){t.drain()}):(c(e,function(e){var i={data:e,callback:u||n};r?t.tasks.unshift(i):t.tasks.push(i),t.tasks.length===t.concurrency&&t.saturated()}),void C.setImmediate(t.process))}function o(n,t){return function(){f-=1;var e=!1,r=arguments;c(t,function(n){c(l,function(t,r){t!==n||e||(l.splice(r,1),e=!0)}),n.callback.apply(n,r)}),n.tasks.length+f===0&&n.drain(),n.process()}}if(null==e)e=1;else if(0===e)throw new Error("Concurrency must not be zero");var f=0,l=[],s={tasks:[],concurrency:e,payload:r,saturated:n,empty:n,drain:n,started:!1,paused:!1,push:function(n,t){i(s,n,!1,t)},kill:function(){s.drain=n,s.tasks=[]},unshift:function(n,t){i(s,n,!0,t)},process:function(){if(!s.paused&&f<s.concurrency&&s.tasks.length)for(;f<s.concurrency&&s.tasks.length;){var n=s.payload?s.tasks.splice(0,s.payload):s.tasks.splice(0,s.tasks.length),e=a(n,function(n){return n.data});0===s.tasks.length&&s.empty(),f+=1,l.push(n[0]);var r=u(o(s,n));t(e,r)}},length:function(){return s.tasks.length},running:function(){return f},workersList:function(){return l},idle:function(){return s.tasks.length+f===0},pause:function(){s.paused=!0},resume:function(){if(s.paused!==!1){s.paused=!1;for(var n=Math.min(s.concurrency,s.tasks.length),t=1;n>=t;t++)C.setImmediate(s.process)}}};return s}function j(n){return m(function(t,e){t.apply(null,e.concat([m(function(t,e){"object"==typeof console&&(t?console.error&&console.error(t):console[n]&&c(e,function(t){console[n](t)}))})]))})}function A(n){return function(t,e,r){n(f(t),e,r)}}function T(n){return m(function(t,e){var r=m(function(e){var r=this,u=e.pop();return n(t,function(n,t,u){n.apply(r,e.concat([u]))},u)});return e.length?r.apply(this,e):r})}function z(n){return m(function(t){var e=t.pop();t.push(function(){var n=arguments;r?C.setImmediate(function(){e.apply(null,n)}):e.apply(null,n)});var r=!0;n.apply(this,t),r=!1})}var q,C={},P="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||this;null!=P&&(q=P.async),C.noConflict=function(){return P.async=q,C};var H=Object.prototype.toString,M=Array.isArray||function(n){return"[object Array]"===H.call(n)},U=function(n){var t=typeof n;return"function"===t||"object"===t&&!!n},W=Object.keys||function(n){var t=[];for(var e in n)n.hasOwnProperty(e)&&t.push(e);return t},B="function"==typeof setImmediate&&setImmediate,D=B?function(n){B(n)}:function(n){setTimeout(n,0)};"object"==typeof process&&"function"==typeof process.nextTick?C.nextTick=process.nextTick:C.nextTick=D,C.setImmediate=B?D:C.nextTick,C.forEach=C.each=function(n,t,e){return C.eachOf(n,y(t),e)},C.forEachSeries=C.eachSeries=function(n,t,e){return C.eachOfSeries(n,y(t),e)},C.forEachLimit=C.eachLimit=function(n,t,e,r){return v(t)(n,y(e),r)},C.forEachOf=C.eachOf=function(t,e,r){function o(n){f--,n?r(n):null===c&&0>=f&&r(null)}r=i(r||n),t=t||[];for(var c,a=h(t),f=0;null!=(c=a());)f+=1,e(t[c],c,u(o));0===f&&r(null)},C.forEachOfSeries=C.eachOfSeries=function(t,e,r){function o(){var n=!0;return null===a?r(null):(e(t[a],a,u(function(t){if(t)r(t);else{if(a=c(),null===a)return r(null);n?C.setImmediate(o):o()}})),void(n=!1))}r=i(r||n),t=t||[];var c=h(t),a=c();o()},C.forEachOfLimit=C.eachOfLimit=function(n,t,e,r){v(t)(n,e,r)},C.map=d(b),C.mapSeries=k(b),C.mapLimit=g(b),C.inject=C.foldl=C.reduce=function(n,t,e,r){C.eachOfSeries(n,function(n,r,u){e(t,n,function(n,e){t=e,u(n)})},function(n){r(n,t)})},C.foldr=C.reduceRight=function(n,e,r,u){var i=a(n,t).reverse();C.reduce(i,e,r,u)},C.transform=function(n,t,e,r){3===arguments.length&&(r=e,e=t,t=M(n)?[]:{}),C.eachOf(n,function(n,r,u){e(t,n,r,u)},function(n){r(n,t)})},C.select=C.filter=d(w),C.selectLimit=C.filterLimit=g(w),C.selectSeries=C.filterSeries=k(w),C.reject=d(O),C.rejectLimit=g(O),C.rejectSeries=k(O),C.any=C.some=S(C.eachOf,e,t),C.someLimit=S(C.eachOfLimit,e,t),C.all=C.every=S(C.eachOf,r,r),C.everyLimit=S(C.eachOfLimit,r,r),C.detect=S(C.eachOf,t,E),C.detectSeries=S(C.eachOfSeries,t,E),C.detectLimit=S(C.eachOfLimit,t,E),C.sortBy=function(n,t,e){function r(n,t){var e=n.criteria,r=t.criteria;return r>e?-1:e>r?1:0}C.map(n,function(n,e){t(n,function(t,r){t?e(t):e(null,{value:n,criteria:r})})},function(n,t){return n?e(n):void e(null,a(t.sort(r),function(n){return n.value}))})},C.auto=function(t,e,r){function u(n){d.unshift(n)}function o(n){var t=p(d,n);t>=0&&d.splice(t,1)}function a(){h--,c(d.slice(0),function(n){n()})}r||(r=e,e=null),r=i(r||n);var f=W(t),h=f.length;if(!h)return r(null);e||(e=h);var y={},v=0,d=[];u(function(){h||r(null,y)}),c(f,function(n){function i(){return e>v&&l(g,function(n,t){return n&&y.hasOwnProperty(t)},!0)&&!y.hasOwnProperty(n)}function c(){i()&&(v++,o(c),h[h.length-1](d,y))}for(var f,h=M(t[n])?t[n]:[t[n]],d=m(function(t,e){if(v--,e.length<=1&&(e=e[0]),t){var u={};s(y,function(n,t){u[t]=n}),u[n]=e,r(t,u)}else y[n]=e,C.setImmediate(a)}),g=h.slice(0,h.length-1),k=g.length;k--;){if(!(f=t[g[k]]))throw new Error("Has inexistant dependency");if(M(f)&&p(f,n)>=0)throw new Error("Has cyclic dependencies")}i()?(v++,h[h.length-1](d,y)):u(c)})},C.retry=function(n,t,e){function r(n,t){if("number"==typeof t)n.times=parseInt(t,10)||i;else{if("object"!=typeof t)throw new Error("Unsupported argument type for 'times': "+typeof t);n.times=parseInt(t.times,10)||i,n.interval=parseInt(t.interval,10)||o}}function u(n,t){function e(n,e){return function(r){n(function(n,t){r(!n||e,{err:n,result:t})},t)}}function r(n){return function(t){setTimeout(function(){t(null)},n)}}for(;a.times;){var u=!(a.times-=1);c.push(e(a.task,u)),!u&&a.interval>0&&c.push(r(a.interval))}C.series(c,function(t,e){e=e[e.length-1],(n||a.callback)(e.err,e.result)})}var i=5,o=0,c=[],a={times:i,interval:o},f=arguments.length;if(1>f||f>3)throw new Error("Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)");return 2>=f&&"function"==typeof n&&(e=t,t=n),"function"!=typeof n&&r(a,n),a.callback=e,a.task=t,a.callback?u():u},C.waterfall=function(t,e){function r(n){return m(function(t,u){if(t)e.apply(null,[t].concat(u));else{var i=n.next();i?u.push(r(i)):u.push(e),z(n).apply(null,u)}})}if(e=i(e||n),!M(t)){var u=new Error("First argument to waterfall must be an array of functions");return e(u)}return t.length?void r(C.iterator(t))():e()},C.parallel=function(n,t){L(C.eachOf,n,t)},C.parallelLimit=function(n,t,e){L(v(t),n,e)},C.series=function(n,t){L(C.eachOfSeries,n,t)},C.iterator=function(n){function t(e){function r(){return n.length&&n[e].apply(null,arguments),r.next()}return r.next=function(){return e<n.length-1?t(e+1):null},r}return t(0)},C.apply=m(function(n,t){return m(function(e){return n.apply(null,t.concat(e))})}),C.concat=d(I),C.concatSeries=k(I),C.whilst=function(t,e,r){if(r=r||n,t()){var u=m(function(n,i){n?r(n):t.apply(this,i)?e(u):r(null)});e(u)}else r(null)},C.doWhilst=function(n,t,e){var r=0;return C.whilst(function(){return++r<=1||t.apply(this,arguments)},n,e)},C.until=function(n,t,e){return C.whilst(function(){return!n.apply(this,arguments)},t,e)},C.doUntil=function(n,t,e){return C.doWhilst(n,function(){return!t.apply(this,arguments)},e)},C.during=function(t,e,r){r=r||n;var u=m(function(n,e){n?r(n):(e.push(i),t.apply(this,e))}),i=function(n,t){n?r(n):t?e(u):r(null)};t(i)},C.doDuring=function(n,t,e){var r=0;C.during(function(n){r++<1?n(null,!0):t.apply(this,arguments)},n,e)},C.queue=function(n,t){var e=x(function(t,e){n(t[0],e)},t,1);return e},C.priorityQueue=function(t,e){function r(n,t){return n.priority-t.priority}function u(n,t,e){for(var r=-1,u=n.length-1;u>r;){var i=r+(u-r+1>>>1);e(t,n[i])>=0?r=i:u=i-1}return r}function i(t,e,i,o){if(null!=o&&"function"!=typeof o)throw new Error("task callback must be a function");return t.started=!0,M(e)||(e=[e]),0===e.length?C.setImmediate(function(){t.drain()}):void c(e,function(e){var c={data:e,priority:i,callback:"function"==typeof o?o:n};t.tasks.splice(u(t.tasks,c,r)+1,0,c),t.tasks.length===t.concurrency&&t.saturated(),C.setImmediate(t.process)})}var o=C.queue(t,e);return o.push=function(n,t,e){i(o,n,t,e)},delete o.unshift,o},C.cargo=function(n,t){return x(n,1,t)},C.log=j("log"),C.dir=j("dir"),C.memoize=function(n,e){var r={},u={};e=e||t;var i=m(function(t){var i=t.pop(),o=e.apply(null,t);o in r?C.setImmediate(function(){i.apply(null,r[o])}):o in u?u[o].push(i):(u[o]=[i],n.apply(null,t.concat([m(function(n){r[o]=n;var t=u[o];delete u[o];for(var e=0,i=t.length;i>e;e++)t[e].apply(null,n)})])))});return i.memo=r,i.unmemoized=n,i},C.unmemoize=function(n){return function(){return(n.unmemoized||n).apply(null,arguments)}},C.times=A(C.map),C.timesSeries=A(C.mapSeries),C.timesLimit=function(n,t,e,r){return C.mapLimit(f(n),t,e,r)},C.seq=function(){var t=arguments;return m(function(e){var r=this,u=e[e.length-1];"function"==typeof u?e.pop():u=n,C.reduce(t,e,function(n,t,e){t.apply(r,n.concat([m(function(n,t){e(n,t)})]))},function(n,t){u.apply(r,[n].concat(t))})})},C.compose=function(){return C.seq.apply(null,Array.prototype.reverse.call(arguments))},C.applyEach=T(C.eachOf),C.applyEachSeries=T(C.eachOfSeries),C.forever=function(t,e){function r(n){return n?i(n):void o(r)}var i=u(e||n),o=z(t);r()},C.ensureAsync=z,C.constant=m(function(n){var t=[null].concat(n);return function(n){return n.apply(this,t)}}),C.wrapSync=C.asyncify=function(n){return m(function(t){var e,r=t.pop();try{e=n.apply(this,t)}catch(u){return r(u)}U(e)&&"function"==typeof e.then?e.then(function(n){r(null,n)})["catch"](function(n){r(n.message?n:new Error(n))}):r(null,e)})},"object"==typeof module&&module.exports?module.exports=C:"function"==typeof define&&define.amd?define([],function(){return C}):P.async=C}();
|
1
|
+
!function(){function n(){}function t(n){return n}function e(n){return!!n}function r(n){return!n}function u(n){return function(){if(null===n)throw new Error("Callback was already called.");n.apply(this,arguments),n=null}}function i(n){return function(){null!==n&&(n.apply(this,arguments),n=null)}}function o(n){return M(n)||"number"==typeof n.length&&n.length>=0&&n.length%1===0}function c(n,t){for(var e=-1,r=n.length;++e<r;)t(n[e],e,n)}function a(n,t){for(var e=-1,r=n.length,u=Array(r);++e<r;)u[e]=t(n[e],e,n);return u}function f(n){return a(Array(n),function(n,t){return t})}function l(n,t,e){return c(n,function(n,r,u){e=t(e,n,r,u)}),e}function s(n,t){c(W(n),function(e){t(n[e],e)})}function p(n,t){for(var e=0;e<n.length;e++)if(n[e]===t)return e;return-1}function h(n){var t,e,r=-1;return o(n)?(t=n.length,function(){return r++,t>r?r:null}):(e=W(n),t=e.length,function(){return r++,t>r?e[r]:null})}function m(n,t){return t=null==t?n.length-1:+t,function(){for(var e=Math.max(arguments.length-t,0),r=Array(e),u=0;e>u;u++)r[u]=arguments[u+t];switch(t){case 0:return n.call(this,r);case 1:return n.call(this,arguments[0],r)}}}function y(n){return function(t,e,r){return n(t,r)}}function v(t){return function(e,r,o){o=i(o||n),e=e||[];var c=h(e);if(0>=t)return o(null);var a=!1,f=0,l=!1;!function s(){if(a&&0>=f)return o(null);for(;t>f&&!l;){var n=c();if(null===n)return a=!0,void(0>=f&&o(null));f+=1,r(e[n],n,u(function(n){f-=1,n?(o(n),l=!0):s()}))}}()}}function d(n){return function(t,e,r){return n(C.eachOf,t,e,r)}}function g(n){return function(t,e,r,u){return n(v(e),t,r,u)}}function k(n){return function(t,e,r){return n(C.eachOfSeries,t,e,r)}}function b(t,e,r,u){u=i(u||n),e=e||[];var c=o(e)?[]:{};t(e,function(n,t,e){r(n,function(n,r){c[t]=r,e(n)})},function(n){u(n,c)})}function w(n,t,e,r){var u=[];n(t,function(n,t,r){e(n,function(e){e&&u.push({index:t,value:n}),r()})},function(){r(a(u.sort(function(n,t){return n.index-t.index}),function(n){return n.value}))})}function O(n,t,e,r){w(n,t,function(n,t){e(n,function(n){t(!n)})},r)}function S(n,t,e){return function(r,u,i,o){function c(){o&&o(e(!1,void 0))}function a(n,r,u){return o?void i(n,function(r){o&&t(r)&&(o(e(!0,n)),o=i=!1),u()}):u()}arguments.length>3?n(r,u,a,c):(o=i,i=u,n(r,a,c))}}function E(n,t){return t}function L(t,e,r){r=r||n;var u=o(e)?[]:{};t(e,function(n,t,e){n(m(function(n,r){r.length<=1&&(r=r[0]),u[t]=r,e(n)}))},function(n){r(n,u)})}function I(n,t,e,r){var u=[];n(t,function(n,t,r){e(n,function(n,t){u=u.concat(t||[]),r(n)})},function(n){r(n,u)})}function x(t,e,r){function i(t,e,r,u){if(null!=u&&"function"!=typeof u)throw new Error("task callback must be a function");return t.started=!0,M(e)||(e=[e]),0===e.length&&t.idle()?C.setImmediate(function(){t.drain()}):(c(e,function(e){var i={data:e,callback:u||n};r?t.tasks.unshift(i):t.tasks.push(i),t.tasks.length===t.concurrency&&t.saturated()}),void C.setImmediate(t.process))}function o(n,t){return function(){f-=1;var e=!1,r=arguments;c(t,function(n){c(l,function(t,r){t!==n||e||(l.splice(r,1),e=!0)}),n.callback.apply(n,r)}),n.tasks.length+f===0&&n.drain(),n.process()}}if(null==e)e=1;else if(0===e)throw new Error("Concurrency must not be zero");var f=0,l=[],s={tasks:[],concurrency:e,payload:r,saturated:n,empty:n,drain:n,started:!1,paused:!1,push:function(n,t){i(s,n,!1,t)},kill:function(){s.drain=n,s.tasks=[]},unshift:function(n,t){i(s,n,!0,t)},process:function(){for(;!s.paused&&f<s.concurrency&&s.tasks.length;){var n=s.payload?s.tasks.splice(0,s.payload):s.tasks.splice(0,s.tasks.length),e=a(n,function(n){return n.data});0===s.tasks.length&&s.empty(),f+=1,l.push(n[0]);var r=u(o(s,n));t(e,r)}},length:function(){return s.tasks.length},running:function(){return f},workersList:function(){return l},idle:function(){return s.tasks.length+f===0},pause:function(){s.paused=!0},resume:function(){if(s.paused!==!1){s.paused=!1;for(var n=Math.min(s.concurrency,s.tasks.length),t=1;n>=t;t++)C.setImmediate(s.process)}}};return s}function j(n){return m(function(t,e){t.apply(null,e.concat([m(function(t,e){"object"==typeof console&&(t?console.error&&console.error(t):console[n]&&c(e,function(t){console[n](t)}))})]))})}function A(n){return function(t,e,r){n(f(t),e,r)}}function T(n){return m(function(t,e){var r=m(function(e){var r=this,u=e.pop();return n(t,function(n,t,u){n.apply(r,e.concat([u]))},u)});return e.length?r.apply(this,e):r})}function z(n){return m(function(t){var e=t.pop();t.push(function(){var n=arguments;r?C.setImmediate(function(){e.apply(null,n)}):e.apply(null,n)});var r=!0;n.apply(this,t),r=!1})}var q,C={},P="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||this;null!=P&&(q=P.async),C.noConflict=function(){return P.async=q,C};var H=Object.prototype.toString,M=Array.isArray||function(n){return"[object Array]"===H.call(n)},U=function(n){var t=typeof n;return"function"===t||"object"===t&&!!n},W=Object.keys||function(n){var t=[];for(var e in n)n.hasOwnProperty(e)&&t.push(e);return t},B="function"==typeof setImmediate&&setImmediate,D=B?function(n){B(n)}:function(n){setTimeout(n,0)};"object"==typeof process&&"function"==typeof process.nextTick?C.nextTick=process.nextTick:C.nextTick=D,C.setImmediate=B?D:C.nextTick,C.forEach=C.each=function(n,t,e){return C.eachOf(n,y(t),e)},C.forEachSeries=C.eachSeries=function(n,t,e){return C.eachOfSeries(n,y(t),e)},C.forEachLimit=C.eachLimit=function(n,t,e,r){return v(t)(n,y(e),r)},C.forEachOf=C.eachOf=function(t,e,r){function o(n){f--,n?r(n):null===c&&0>=f&&r(null)}r=i(r||n),t=t||[];for(var c,a=h(t),f=0;null!=(c=a());)f+=1,e(t[c],c,u(o));0===f&&r(null)},C.forEachOfSeries=C.eachOfSeries=function(t,e,r){function o(){var n=!0;return null===a?r(null):(e(t[a],a,u(function(t){if(t)r(t);else{if(a=c(),null===a)return r(null);n?C.setImmediate(o):o()}})),void(n=!1))}r=i(r||n),t=t||[];var c=h(t),a=c();o()},C.forEachOfLimit=C.eachOfLimit=function(n,t,e,r){v(t)(n,e,r)},C.map=d(b),C.mapSeries=k(b),C.mapLimit=g(b),C.inject=C.foldl=C.reduce=function(n,t,e,r){C.eachOfSeries(n,function(n,r,u){e(t,n,function(n,e){t=e,u(n)})},function(n){r(n,t)})},C.foldr=C.reduceRight=function(n,e,r,u){var i=a(n,t).reverse();C.reduce(i,e,r,u)},C.transform=function(n,t,e,r){3===arguments.length&&(r=e,e=t,t=M(n)?[]:{}),C.eachOf(n,function(n,r,u){e(t,n,r,u)},function(n){r(n,t)})},C.select=C.filter=d(w),C.selectLimit=C.filterLimit=g(w),C.selectSeries=C.filterSeries=k(w),C.reject=d(O),C.rejectLimit=g(O),C.rejectSeries=k(O),C.any=C.some=S(C.eachOf,e,t),C.someLimit=S(C.eachOfLimit,e,t),C.all=C.every=S(C.eachOf,r,r),C.everyLimit=S(C.eachOfLimit,r,r),C.detect=S(C.eachOf,t,E),C.detectSeries=S(C.eachOfSeries,t,E),C.detectLimit=S(C.eachOfLimit,t,E),C.sortBy=function(n,t,e){function r(n,t){var e=n.criteria,r=t.criteria;return r>e?-1:e>r?1:0}C.map(n,function(n,e){t(n,function(t,r){t?e(t):e(null,{value:n,criteria:r})})},function(n,t){return n?e(n):void e(null,a(t.sort(r),function(n){return n.value}))})},C.auto=function(t,e,r){function u(n){g.unshift(n)}function o(n){var t=p(g,n);t>=0&&g.splice(t,1)}function a(){h--,c(g.slice(0),function(n){n()})}"function"==typeof arguments[1]&&(r=e,e=null),r=i(r||n);var f=W(t),h=f.length;if(!h)return r(null);e||(e=h);var y={},v=0,d=!1,g=[];u(function(){h||r(null,y)}),c(f,function(n){function i(){return e>v&&l(k,function(n,t){return n&&y.hasOwnProperty(t)},!0)&&!y.hasOwnProperty(n)}function c(){i()&&(v++,o(c),h[h.length-1](g,y))}if(!d){for(var f,h=M(t[n])?t[n]:[t[n]],g=m(function(t,e){if(v--,e.length<=1&&(e=e[0]),t){var u={};s(y,function(n,t){u[t]=n}),u[n]=e,d=!0,r(t,u)}else y[n]=e,C.setImmediate(a)}),k=h.slice(0,h.length-1),b=k.length;b--;){if(!(f=t[k[b]]))throw new Error("Has inexistant dependency");if(M(f)&&p(f,n)>=0)throw new Error("Has cyclic dependencies")}i()?(v++,h[h.length-1](g,y)):u(c)}})},C.retry=function(n,t,e){function r(n,t){if("number"==typeof t)n.times=parseInt(t,10)||i;else{if("object"!=typeof t)throw new Error("Unsupported argument type for 'times': "+typeof t);n.times=parseInt(t.times,10)||i,n.interval=parseInt(t.interval,10)||o}}function u(n,t){function e(n,e){return function(r){n(function(n,t){r(!n||e,{err:n,result:t})},t)}}function r(n){return function(t){setTimeout(function(){t(null)},n)}}for(;a.times;){var u=!(a.times-=1);c.push(e(a.task,u)),!u&&a.interval>0&&c.push(r(a.interval))}C.series(c,function(t,e){e=e[e.length-1],(n||a.callback)(e.err,e.result)})}var i=5,o=0,c=[],a={times:i,interval:o},f=arguments.length;if(1>f||f>3)throw new Error("Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)");return 2>=f&&"function"==typeof n&&(e=t,t=n),"function"!=typeof n&&r(a,n),a.callback=e,a.task=t,a.callback?u():u},C.waterfall=function(t,e){function r(n){return m(function(t,u){if(t)e.apply(null,[t].concat(u));else{var i=n.next();i?u.push(r(i)):u.push(e),z(n).apply(null,u)}})}if(e=i(e||n),!M(t)){var u=new Error("First argument to waterfall must be an array of functions");return e(u)}return t.length?void r(C.iterator(t))():e()},C.parallel=function(n,t){L(C.eachOf,n,t)},C.parallelLimit=function(n,t,e){L(v(t),n,e)},C.series=function(n,t){L(C.eachOfSeries,n,t)},C.iterator=function(n){function t(e){function r(){return n.length&&n[e].apply(null,arguments),r.next()}return r.next=function(){return e<n.length-1?t(e+1):null},r}return t(0)},C.apply=m(function(n,t){return m(function(e){return n.apply(null,t.concat(e))})}),C.concat=d(I),C.concatSeries=k(I),C.whilst=function(t,e,r){if(r=r||n,t()){var u=m(function(n,i){n?r(n):t.apply(this,i)?e(u):r.apply(null,[null].concat(i))});e(u)}else r(null)},C.doWhilst=function(n,t,e){var r=0;return C.whilst(function(){return++r<=1||t.apply(this,arguments)},n,e)},C.until=function(n,t,e){return C.whilst(function(){return!n.apply(this,arguments)},t,e)},C.doUntil=function(n,t,e){return C.doWhilst(n,function(){return!t.apply(this,arguments)},e)},C.during=function(t,e,r){r=r||n;var u=m(function(n,e){n?r(n):(e.push(i),t.apply(this,e))}),i=function(n,t){n?r(n):t?e(u):r(null)};t(i)},C.doDuring=function(n,t,e){var r=0;C.during(function(n){r++<1?n(null,!0):t.apply(this,arguments)},n,e)},C.queue=function(n,t){var e=x(function(t,e){n(t[0],e)},t,1);return e},C.priorityQueue=function(t,e){function r(n,t){return n.priority-t.priority}function u(n,t,e){for(var r=-1,u=n.length-1;u>r;){var i=r+(u-r+1>>>1);e(t,n[i])>=0?r=i:u=i-1}return r}function i(t,e,i,o){if(null!=o&&"function"!=typeof o)throw new Error("task callback must be a function");return t.started=!0,M(e)||(e=[e]),0===e.length?C.setImmediate(function(){t.drain()}):void c(e,function(e){var c={data:e,priority:i,callback:"function"==typeof o?o:n};t.tasks.splice(u(t.tasks,c,r)+1,0,c),t.tasks.length===t.concurrency&&t.saturated(),C.setImmediate(t.process)})}var o=C.queue(t,e);return o.push=function(n,t,e){i(o,n,t,e)},delete o.unshift,o},C.cargo=function(n,t){return x(n,1,t)},C.log=j("log"),C.dir=j("dir"),C.memoize=function(n,e){var r={},u={};e=e||t;var i=m(function(t){var i=t.pop(),o=e.apply(null,t);o in r?C.setImmediate(function(){i.apply(null,r[o])}):o in u?u[o].push(i):(u[o]=[i],n.apply(null,t.concat([m(function(n){r[o]=n;var t=u[o];delete u[o];for(var e=0,i=t.length;i>e;e++)t[e].apply(null,n)})])))});return i.memo=r,i.unmemoized=n,i},C.unmemoize=function(n){return function(){return(n.unmemoized||n).apply(null,arguments)}},C.times=A(C.map),C.timesSeries=A(C.mapSeries),C.timesLimit=function(n,t,e,r){return C.mapLimit(f(n),t,e,r)},C.seq=function(){var t=arguments;return m(function(e){var r=this,u=e[e.length-1];"function"==typeof u?e.pop():u=n,C.reduce(t,e,function(n,t,e){t.apply(r,n.concat([m(function(n,t){e(n,t)})]))},function(n,t){u.apply(r,[n].concat(t))})})},C.compose=function(){return C.seq.apply(null,Array.prototype.reverse.call(arguments))},C.applyEach=T(C.eachOf),C.applyEachSeries=T(C.eachOfSeries),C.forever=function(t,e){function r(n){return n?i(n):void o(r)}var i=u(e||n),o=z(t);r()},C.ensureAsync=z,C.constant=m(function(n){var t=[null].concat(n);return function(n){return n.apply(this,t)}}),C.wrapSync=C.asyncify=function(n){return m(function(t){var e,r=t.pop();try{e=n.apply(this,t)}catch(u){return r(u)}U(e)&&"function"==typeof e.then?e.then(function(n){r(null,n)})["catch"](function(n){r(n.message?n:new Error(n))}):r(null,e)})},"object"==typeof module&&module.exports?module.exports=C:"function"==typeof define&&define.amd?define([],function(){return C}):P.async=C}();
|
2
2
|
//# sourceMappingURL=dist/async.min.map
|
@@ -510,7 +510,7 @@
|
|
510
510
|
};
|
511
511
|
|
512
512
|
async.auto = function (tasks, concurrency, callback) {
|
513
|
-
if (
|
513
|
+
if (typeof arguments[1] === 'function') {
|
514
514
|
// concurrency is optional, shift the args.
|
515
515
|
callback = concurrency;
|
516
516
|
concurrency = null;
|
@@ -528,6 +528,8 @@
|
|
528
528
|
var results = {};
|
529
529
|
var runningTasks = 0;
|
530
530
|
|
531
|
+
var hasError = false;
|
532
|
+
|
531
533
|
var listeners = [];
|
532
534
|
function addListener(fn) {
|
533
535
|
listeners.unshift(fn);
|
@@ -550,6 +552,7 @@
|
|
550
552
|
});
|
551
553
|
|
552
554
|
_arrayEach(keys, function (k) {
|
555
|
+
if (hasError) return;
|
553
556
|
var task = _isArray(tasks[k]) ? tasks[k]: [tasks[k]];
|
554
557
|
var taskCallback = _restParam(function(err, args) {
|
555
558
|
runningTasks--;
|
@@ -562,6 +565,8 @@
|
|
562
565
|
safeResults[rkey] = val;
|
563
566
|
});
|
564
567
|
safeResults[k] = args;
|
568
|
+
hasError = true;
|
569
|
+
|
565
570
|
callback(err, safeResults);
|
566
571
|
}
|
567
572
|
else {
|
@@ -781,7 +786,7 @@
|
|
781
786
|
} else if (test.apply(this, args)) {
|
782
787
|
iterator(next);
|
783
788
|
} else {
|
784
|
-
callback(null);
|
789
|
+
callback.apply(null, [null].concat(args));
|
785
790
|
}
|
786
791
|
});
|
787
792
|
iterator(next);
|
@@ -929,24 +934,23 @@
|
|
929
934
|
_insert(q, data, true, callback);
|
930
935
|
},
|
931
936
|
process: function () {
|
932
|
-
|
933
|
-
while(workers < q.concurrency && q.tasks.length){
|
934
|
-
var tasks = q.payload ?
|
935
|
-
q.tasks.splice(0, q.payload) :
|
936
|
-
q.tasks.splice(0, q.tasks.length);
|
937
|
-
|
938
|
-
var data = _map(tasks, function (task) {
|
939
|
-
return task.data;
|
940
|
-
});
|
937
|
+
while(!q.paused && workers < q.concurrency && q.tasks.length){
|
941
938
|
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
947
|
-
|
948
|
-
|
939
|
+
var tasks = q.payload ?
|
940
|
+
q.tasks.splice(0, q.payload) :
|
941
|
+
q.tasks.splice(0, q.tasks.length);
|
942
|
+
|
943
|
+
var data = _map(tasks, function (task) {
|
944
|
+
return task.data;
|
945
|
+
});
|
946
|
+
|
947
|
+
if (q.tasks.length === 0) {
|
948
|
+
q.empty();
|
949
949
|
}
|
950
|
+
workers += 1;
|
951
|
+
workersList.push(tasks[0]);
|
952
|
+
var cb = only_once(_next(q, tasks));
|
953
|
+
worker(data, cb);
|
950
954
|
}
|
951
955
|
},
|
952
956
|
length: function () {
|