String normalize(String url)

Given a string representing a URL, returns the normalized URL path without leading or trailing slashes

Source

String normalize(String url) {
  return Location.stripTrailingSlash(
      _stripBaseHref(this._baseHref, _stripIndexHtml(url)));
}