mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-04 14:49:01 +02:00
27335633a9
PDF Detach GitOrigin-RevId: f69d8a87d1ba2115ad496a719106dfc7707a6ed5
12 lines
288 B
JavaScript
12 lines
288 B
JavaScript
export function buildUrlWithDetachRole(mode) {
|
|
const url = new URL(window.location)
|
|
const cleanPathname = url.pathname
|
|
.replace(/\/(detached|detacher)\/?$/, '')
|
|
.replace(/\/$/, '')
|
|
url.pathname = cleanPathname
|
|
if (mode) {
|
|
url.pathname += `/${mode}`
|
|
}
|
|
return url
|
|
}
|