diff options
Diffstat (limited to 'node_modules/bluebird/js/main/any.js')
-rw-r--r-- | node_modules/bluebird/js/main/any.js | 21 |
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); +}; + +}; |