parcoursup/node_modules/release-zalgo/lib/Async.js
lalBi94 7bc56c09b5 $
2023-03-05 13:23:23 +01:00

22 lines
368 B
JavaScript

'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