Total Complexity | 2 |
Complexity/F | 2 |
Lines of Code | 24 |
Function Count | 1 |
Duplicated Lines | 0 |
Ratio | 0 % |
Coverage | 100% |
Changes | 0 |
1 | import {IPageData} from '@enbock/application-router/Router'; |
||
2 | import {IObserver} from '@enbock/state-value-observer/Observer'; |
||
3 | import {IModulePageData} from '../Application/Application'; |
||
4 | |||
5 | export default class RouterData { |
||
6 | private routerData: IObserver<IModulePageData | null>; |
||
7 | |||
8 | constructor(routerData: IObserver<IPageData | null>) { |
||
9 | 3 | this.routerData = routerData as IObserver<IModulePageData | null>; |
|
10 | } |
||
11 | |||
12 | migrateRouterInternalToV102(): void { |
||
13 | 3 | const pageData: IPageData | null | any = this.routerData.value; |
|
14 | 4 | if (pageData == null || pageData.rootUrl == undefined) return; |
|
15 | |||
16 | 1 | this.routerData.value = { |
|
17 | baseUrl: pageData.rootUrl, |
||
18 | currentUrl: pageData.url, |
||
19 | name: pageData.name, |
||
20 | module: pageData.module |
||
21 | }; |
||
22 | } |
||
23 | } |
||
24 |