MCPcopy Create free account
hub / github.com/MankaiHuang/screen-visualization / getAuthorityFromRouter

Function getAuthorityFromRouter

src/utils/utils.js:17–25  ·  view source on GitHub ↗
(router = [], pathname)

Source from the content-addressed store, hash-verified

15 */
16
17export 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};
26export const getRouteAuthority = (path, routeData) => {
27 let authorities;
28 routeData.forEach(route => {

Callers 1

BasicLayoutFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected