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

  return "ready";
}
@template {ServerResponse & ExpectedServerResponse} Response
@param {Response} res res
@returns {"ready" | "open" | "readable"} state