Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const exec = (
middleware: H.Middleware,
req: fastify.FastifyRequest,
res: fastify.FastifyReply,
): Promise =>
H.execMiddleware(middleware, new FastifyConnection<i>(req, res))().then(e =>
pipe(
e,
fold(constVoid, c => {
const { actions: list, reply } = c as FastifyConnection
const len = list.length
const actions = LL.toReversedArray(list)
for (let i = 0; i < len; i++) {
run(reply, actions[i])
}
}),
),
)
</i>