formatURI()function
formatURI(url: PossibleURI, caller: AnyCaller = formatURI): string
| Param | Type | |
|---|---|---|
url | PossibleURI | URI to format. required |
caller | AnyCaller |
| 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.
- e.g.
mailto:[email protected]→[email protected] - e.g.
http://shax.com/test?uid=129483→shax.com/test
Examples
formatURI("http://shax.com/test?uid=129483") // "shax.com/test"