GenAI_Course / node_modules /msw /src /browser /utils /getAbsoluteWorkerUrl.ts
sam522's picture
node
d4b85c0
raw
history blame contribute delete
234 Bytes
/**
* Returns an absolute Service Worker URL based on the given
* relative URL (known during the registration).
*/
export function getAbsoluteWorkerUrl(workerUrl: string): string {
return new URL(workerUrl, location.href).href
}