(router_?: Router)
| 44 | let _route: Ref<RouteLocationNormalized>; |
| 45 | |
| 46 | export function route(router_?: Router) { |
| 47 | if (_route != null) { |
| 48 | return _route; |
| 49 | } |
| 50 | |
| 51 | let route: Ref<RouteLocationNormalized> | undefined; |
| 52 | |
| 53 | if (route == null) { |
| 54 | route = router(router_).currentRoute; |
| 55 | } |
| 56 | |
| 57 | if (route == null) { |
| 58 | throw new Error('Unable to load route.'); |
| 59 | } |
| 60 | |
| 61 | if (process.env.CLIENT) { |
| 62 | _route = route; |
| 63 | } |
| 64 | |
| 65 | return route; |
| 66 | } |
no outgoing calls
no test coverage detected