function initState(res) {
  if (typeof res.setState === "function") {
    return;
  }

  // fixes #282. credit @cexoso. in certain edge situations res.locals is undefined.
  res.locals ||= {};
}
@template {ServerResponse & ExpectedServerResponse} Response
@param {Response} res res