zacks
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
2 deletions
-
src/utils/utils.ts
|
|
|
@ -35,8 +35,8 @@ export const getAuthorityFromRouter = <T extends Route>( |
|
|
|
pathname: string, |
|
|
|
): T | undefined => { |
|
|
|
const authority = router.find( |
|
|
|
({ routes, path = '/' }) => |
|
|
|
(path && pathRegexp(path).exec(pathname)) || |
|
|
|
({ routes, path = '/', target = '_self' }) => |
|
|
|
(path && target !== '_blank' && pathRegexp(path).exec(pathname)) || |
|
|
|
(routes && getAuthorityFromRouter(routes, pathname)), |
|
|
|
); |
|
|
|
if (authority) return authority; |
|
|
|
|