summaryrefslogtreecommitdiffstats
path: root/src/util.coffee
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.coffee')
-rw-r--r--src/util.coffee15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/util.coffee b/src/util.coffee
index d2cea04..4e0cd76 100644
--- a/src/util.coffee
+++ b/src/util.coffee
@@ -1,12 +1,13 @@
'use strict'
-_ = require 'lodash'
module.exports =
mapPromises: (promises) ->
- _.reduce promises, ((seq, v, k) ->
- seq.then (acc) ->
- v.then (r) ->
- acc[k] = r
- acc
- ), Promise.resolve {}
+ p = []
+ ret = {}
+
+ for own k, v of promises
+ do (k, v) ->
+ p.push(v.then (r) -> ret[k] = r)
+
+ Promise.all(p).then -> ret