function setState(res, name, value) {
  if (typeof res.setState === "function") {
    res.setState(name, value);

    return;
  }

  // eslint-disable-next-line jsdoc/no-restricted-syntax
  /** @type {any} */
  (res.locals)[name] = value;
}
@template {ServerResponse & ExpectedServerResponse} Response
@param {Response} res res
@param {string} name name
@param {any} value state
@returns {void}