Skip to main content

Url Helpers

Utility functions for working with urls.

Functions

FunctionDescription
cleanPathClean an URL by removing duplicate slashes.
extractPureURIExtracts the pure URI from a URL by removing query parameters and fragments.
onlyPathExtract only the path from an URI with optional query and fragments.
relativeURLToAbsoluterelativeURLToAbsolute
withLeadingSlashAdds a leading slash / to the given URL if it is not already present.
withTrailingSlashAdds a trailing slash / to the given URL if it is not already present.
withoutLeadingSlashRemoves the leading slash / from the given URL if it is present.
withoutTrailingSlashRemoves the trailing slash / from the given URL if it is present.