refactor(router): minor refactoring
This commit is contained in:
parent
3bd0ce291e
commit
3683fb6886
@ -89,6 +89,7 @@ function expandWildCardWithParamsAgainstRouteUsingRedirect(route: Route): UrlSeg
|
|||||||
return new UrlSegment(newPaths, {});
|
return new UrlSegment(newPaths, {});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function expandRegularPathWithParamsAgainstRouteUsingRedirect(
|
function expandRegularPathWithParamsAgainstRouteUsingRedirect(
|
||||||
segment: UrlSegment, routes: Route[], route: Route, paths: UrlPathWithParams[],
|
segment: UrlSegment, routes: Route[], route: Route, paths: UrlPathWithParams[],
|
||||||
outlet: string): UrlSegment {
|
outlet: string): UrlSegment {
|
||||||
@ -169,9 +170,10 @@ function applyRedirectCommands(
|
|||||||
posParams: {[k: string]: UrlPathWithParams}): UrlPathWithParams[] {
|
posParams: {[k: string]: UrlPathWithParams}): UrlPathWithParams[] {
|
||||||
if (redirectTo.startsWith('/')) {
|
if (redirectTo.startsWith('/')) {
|
||||||
const parts = redirectTo.substring(1).split('/');
|
const parts = redirectTo.substring(1).split('/');
|
||||||
throw new GlobalRedirect(createPaths(redirectTo, parts, paths, posParams));
|
return createPaths(redirectTo, parts, paths, posParams);
|
||||||
} else {
|
} else {
|
||||||
return createPaths(redirectTo, redirectTo.split('/'), paths, posParams);
|
const parts = redirectTo.split('/');
|
||||||
|
return createPaths(redirectTo, parts, paths, posParams);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user