function finish(res, data) {
  // Pseudo API and Express API and Koa API
  if (typeof res.finish === "function") {
    res.finish(data);
    return;
  }

  // Pseudo API and Express API and Koa API
  res.end(data);
}
@template {ServerResponse & ExpectedServerResponse} Response
@param {Response} res res
@param {(string | Buffer)=} data data