aboutsummaryrefslogtreecommitdiff
path: root/node_modules/release-zalgo/lib/Async.js
blob: 846f7add0e7965d1c90cf8a8d4ec8663bd9f7f9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
'use strict'

class Async {
  run (executors) {
    const args = Array.from(arguments).slice(1)
    return new Promise(resolve => resolve(executors.async.apply(null, args)))
  }

  all (arr) {
    return Promise.all(arr)
  }

  returns (value) {
    return Promise.resolve(value)
  }

  throws (reason) {
    return Promise.reject(reason)
  }
}
module.exports = Async