Sha256: 3fa0e6b674cfd890073f085b7c39f3a025fafe1cece04145410187d9758ea697
Contents?: true
Size: 449 Bytes
Versions: 26
Compression:
Stored size: 449 Bytes
Contents
/** * Returns a relative URL if the given request URL is relative * to the current origin. Otherwise returns an absolute URL. */ export function toPublicUrl(url: string | URL): string { if (typeof location === 'undefined') { return url.toString() } const urlInstance = url instanceof URL ? url : new URL(url) return urlInstance.origin === location.origin ? urlInstance.pathname : urlInstance.origin + urlInstance.pathname }
Version data entries
26 entries across 26 versions & 1 rubygems