mirror of
https://github.com/flarum/framework.git
synced 2024-12-03 07:33:36 +08:00
ffc2863f70
Also give the root controller the name of the current route so they can easily route back to it
9 lines
182 B
JavaScript
9 lines
182 B
JavaScript
export default function mapRoutes(routes) {
|
|
var map = {};
|
|
for (var r in routes) {
|
|
routes[r][1].props.routeName = r;
|
|
map[routes[r][0]] = routes[r][1];
|
|
}
|
|
return map;
|
|
}
|