Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/bluebird/js/main/any.js')
-rw-r--r--node_modules/bluebird/js/main/any.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/node_modules/bluebird/js/main/any.js b/node_modules/bluebird/js/main/any.js
new file mode 100644
index 000000000..05a6228ef
--- /dev/null
+++ b/node_modules/bluebird/js/main/any.js
@@ -0,0 +1,21 @@
+"use strict";
+module.exports = function(Promise) {
+var SomePromiseArray = Promise._SomePromiseArray;
+function any(promises) {
+ var ret = new SomePromiseArray(promises);
+ var promise = ret.promise();
+ ret.setHowMany(1);
+ ret.setUnwrap();
+ ret.init();
+ return promise;
+}
+
+Promise.any = function (promises) {
+ return any(promises);
+};
+
+Promise.prototype.any = function () {
+ return any(this);
+};
+
+};