index.js 201 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 const asyncUtil = fn => function asyncUtilWrap(...args) { const fnReturn = fn(...args) const next = args[args.length-1] return Promise.resolve(fnReturn).catch(next) } module.exports = asyncUtil