can this be further simplified

i have run into an issue in an astro template and am gonna make a pr with the fix. but the current solution feels hacky
const { href, class: className, ...props } = Astro.props;
let pathnameWithoutSlash = Astro.url.pathname.replace(/\/$/, "");

if (href === "/" && pathnameWithoutSlash === "") {
  pathnameWithoutSlash = "/";
}

const isActive = href === pathnameWithoutSlash;


can this be simplified somehow? should i just make a pr and let the maintainers review it?
Was this page helpful?