onlyPath
Extract only the path from an URI with optional query and fragments.
For example, all these parameters will return /path:
/path/path?query=thing/path#fragment/path?query=thing#fragment
Available since v1.0.0
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
url | string | The URL string to be processed. Can be `string`, `undefined`, or `null`. |
Returns
Section titled “Returns”string — The URL string without query and fragment, or undefined if the input is undefined, or null if the input is null.
Examples
Section titled “Examples”Extract the path from a URL
Section titled “Extract the path from a URL”Strips query parameters and fragments from a URL path.
