source: frontend/node_modules/bluebird/js/release/each.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 789 bytes
Line 
1"use strict";
2module.exports = function(Promise, INTERNAL) {
3var PromiseReduce = Promise.reduce;
4var PromiseAll = Promise.all;
5
6function promiseAllThis() {
7 return PromiseAll(this);
8}
9
10function PromiseMapSeries(promises, fn) {
11 return PromiseReduce(promises, fn, INTERNAL, INTERNAL);
12}
13
14Promise.prototype.each = function (fn) {
15 return PromiseReduce(this, fn, INTERNAL, 0)
16 ._then(promiseAllThis, undefined, undefined, this, undefined);
17};
18
19Promise.prototype.mapSeries = function (fn) {
20 return PromiseReduce(this, fn, INTERNAL, INTERNAL);
21};
22
23Promise.each = function (promises, fn) {
24 return PromiseReduce(promises, fn, INTERNAL, 0)
25 ._then(promiseAllThis, undefined, undefined, promises, undefined);
26};
27
28Promise.mapSeries = PromiseMapSeries;
29};
30
Note: See TracBrowser for help on using the repository browser.