toFullUrl
toFullUrl(url, options)
toFullUrl(url, options)
Converts a partial URL to a full URL by adding missing components like protocol and domain. This function enhances partial URLs to complete URLs by ensuring all necessary components are included.
Arguments
url
(string): The partial URL to convert to a full URL.options
(Record<string, any> | undefined): Additional options for customizing the URL conversion. Defaults toundefined
.
Returns
string
: The full URL with all necessary components added.
Example
Usage
Notes
The
toFullUrl
function transforms partial URLs into complete URLs by adding missing components like protocol and domain.It provides flexibility with additional options to customize the URL conversion process.
This function is useful for ensuring that URLs are properly formatted and complete for use in web applications.
Last updated
Was this helpful?