1
0
Fork 0
mirror of synced 2024-06-30 12:00:31 +12:00

Fix spaces in screen URLs

This commit is contained in:
Andrew Kingston 2022-04-07 16:06:04 +01:00
parent 4a4d776c02
commit c9ef46d2bf

View file

@ -3,13 +3,14 @@ export default function (url) {
.split("/")
.map(part => {
part = decodeURIComponent(part)
part = part.replace(/ /g, "-")
// If parameter, then use as is
if (!part.startsWith(":")) {
part = encodeURIComponent(part)
}
return part.replace(/ /g, "-")
return part
})
.join("/")
.toLowerCase()