formatURI()function

formatURI(url: PossibleURI, caller: AnyCaller = formatURI): string
ParamType
urlPossibleURI
URI to format. required
callerAnyCaller
Function to attribute a thrown error to (defaults to formatURI itself). Defaults to formatURI
Return
string
Friendly string showing the host and path with any trailing slash removed.
Throws
RequiredError
If url cannot be converted to a valid URI.

Format a URI as a user-friendly string.

Examples

formatURI("http://shax.com/test?uid=129483") // "shax.com/test"