mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-07 14:05:44 +01:00
fixed changeset urls without slash at the end
This commit is contained in:
@@ -5,6 +5,21 @@ export function withContextPath(path: string) {
|
||||
return contextPath + path;
|
||||
}
|
||||
|
||||
export function withEndingSlash(url: string) {
|
||||
if (url.endsWith("/")) {
|
||||
return url;
|
||||
}
|
||||
return url + "/";
|
||||
}
|
||||
|
||||
export function concat(base: string, ...parts: string) {
|
||||
let url = base;
|
||||
for ( let p of parts) {
|
||||
url = withEndingSlash(url) + p;
|
||||
}
|
||||
return url;
|
||||
}
|
||||
|
||||
export function getPageFromMatch(match: any) {
|
||||
let page = parseInt(match.params.page, 10);
|
||||
if (isNaN(page) || !page) {
|
||||
|
||||
Reference in New Issue
Block a user