code: function pathIsActive(pathname, currentPathname) {
    // Normalize leading slash for consistency. Leading slash on pathname has
    // already been normalized in isActive. See caveat there.
    if (currentPathname.charAt(0) !== '/') {
      currentPathname = '/' + currentPathname;
    }
  
    // Normalize the end of both path names too. Maybe `/foo/` shouldn't show
    // `/foo` as active, but in this case, we would already have failed the
    // match.
    if (pathname.charAt(pathname.length - 1) !== '/') {
      pathname += '/';
    }
    if (currentPathname.charAt(currentPathname.length - 1) !== '/') {
      currentPathname += '/';
    }
  
    return currentPathname === pathname;
  }
docs: Returns true if the current pathname matches the supplied one, net of
  leading and trailing slash normalization. This is sufficient for an
  indexOnly route match.