function koaConnect(connectMiddleware, options) {
  return async (ctx, next) => {
    ctx.respond = false;
    try {
      const goNext = await handler(ctx, connectMiddleware, options);

      if (goNext) {
        ctx.respond = true;
        return next();
      }
    } catch (err) {
      ctx.respond = true;
      throw err;
    }
    return next();
  };
}
Returns a Koa middleware function that varies its async logic based on if the
given middleware function declares at least 3 parameters, i.e. includes
the `next` callback function