next-cloudflare/lib/asyncCompose.js

14 lines
233 B
JavaScript
Raw Normal View History

2019-02-18 07:55:52 +00:00
const asyncCompose = (...funcs) => {
return async (argument) => {
let current = argument;
for (const func of funcs) {
current = await func(current);
}
return current;
};
};
module.exports = asyncCompose;