Function: getBaseUrl()
ts
function getBaseUrl(fullUrl): string;Defined in: getBaseUrl.ts:12
Gets the base URL from a full URL or a URL object.
Parameters
fullUrl
string | URL
The full URL or URL object.
Returns
string
The base URL.
Example
ts
const baseUrl = getBaseUrl('https://example.com/path/to/file.mp4')
equal(baseUrl, 'https://example.com/path/to/')