overleaf/services/chat/app/js/util/promises.js
Eric Mc Sween 0a12c47b35 Merge pull request #10815 from overleaf/em-esm-chat
Move chat service to ES modules

GitOrigin-RevId: c08ae8328b8f3b539e6cfe052834b84bb3756330
2022-12-14 09:03:03 +00:00

10 lines
240 B
JavaScript

/**
* Transform an async function into an Express middleware
*
* Any error will be passed to the error middlewares via `next()`
*/
export function expressify(fn) {
return (req, res, next) => {
fn(req, res, next).catch(next)
}
}