@coderich/util
Advanced tools
Comparing version 0.0.5 to 0.0.6
{ | ||
"name": "@coderich/util", | ||
"main": "src/index.js", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"publishConfig": { | ||
@@ -6,0 +6,0 @@ "access": "public" |
@@ -47,1 +47,11 @@ const ChildProcess = require('child_process'); | ||
}; | ||
exports.promiseChain = (promiseThunks) => { | ||
return promiseThunks.reduce((chain, promiseThunk) => { | ||
return chain.then((chainResult) => { | ||
return promiseThunk(chainResult).then((promiseResult) => { | ||
return [...chainResult, promiseResult]; | ||
}); | ||
}); | ||
}, Promise.resolve([])); | ||
}; |
2251
48