Skip to content
This repository was archived by the owner on May 25, 2021. It is now read-only.

Commit ba269df

Browse files
authored
Merge pull request #1423 from rangle/adding-redirect-to-route-naming
adding redirect to route path description
2 parents 010376b + dfdab0e commit ba269df

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/backend/utils/parse-router.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ export function parseRoutes(router: any): Route {
2222
isAux: false,
2323
specificity: null,
2424
data: null,
25-
hash: null,
25+
hash: null
2626
};
2727

2828
return root;
2929
}
3030

3131
function assignChildrenToParent(parentPath, children): [any] {
32-
return children.map((child) => {
32+
return children.map(child => {
3333
const childName = childRouteName(child);
3434
const childDescendents: [any] = child._loadedConfig ? child._loadedConfig.routes : child.children;
3535

@@ -46,7 +46,7 @@ function assignChildrenToParent(parentPath, children): [any] {
4646
name: childName,
4747
path: `${parentPath ? parentPath : ''}/${pathFragment}`.split('//').join('/'),
4848
isAux: isAuxRoute,
49-
children: [],
49+
children: []
5050
};
5151

5252
if (childDescendents) {
@@ -58,7 +58,7 @@ function assignChildrenToParent(parentPath, children): [any] {
5858
if (child.data.hasOwnProperty(el)) {
5959
routeConfig.data.push({
6060
key: el,
61-
value: child.data[el],
61+
value: child.data[el]
6262
});
6363
}
6464
}
@@ -71,11 +71,11 @@ function assignChildrenToParent(parentPath, children): [any] {
7171
function childRouteName(child): string {
7272
if (child.component) {
7373
return child.component.name;
74-
}
75-
else if (child.loadChildren) {
74+
} else if (child.loadChildren) {
7675
return `${child.path} [Lazy]`;
77-
}
78-
else {
76+
} else if (child.redirectTo) {
77+
return `${child.path} -> redirecting to -> "${child.redirectTo}"`;
78+
} else {
7979
return 'no-name-route';
8080
}
8181
}

0 commit comments

Comments
 (0)