(router = [], pathname)
| 15 | */ |
| 16 | |
| 17 | export const getAuthorityFromRouter = (router = [], pathname) => { |
| 18 | const authority = router.find( |
| 19 | ({ routes, path = '/' }) => |
| 20 | (path && pathRegexp(path).exec(pathname)) || |
| 21 | (routes && getAuthorityFromRouter(routes, pathname)), |
| 22 | ); |
| 23 | if (authority) return authority; |
| 24 | return undefined; |
| 25 | }; |
| 26 | export const getRouteAuthority = (path, routeData) => { |
| 27 | let authorities; |
| 28 | routeData.forEach(route => { |