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