addLeadingSlash
Simple helper that adds a leading slash / if not yet present.
Available since v1.0.1
Import
Section titled “Import”Signature
Section titled “Signature”Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
url | string | A valid URL. |
Returns
Section titled “Returns”string — The URL with a leading slash, unchanged if it already had one.
