(mod, _rawModule)
| 1017 | // Try updating routes with lazy loading |
| 1018 | |
| 1019 | const loopInsideModule = (mod, _rawModule) => { |
| 1020 | if (mod.children) { |
| 1021 | for (const z in mod.children) { |
| 1022 | const route = this.foundRouteWithModuleName(mod.children[z].name); |
| 1023 | if (typeof route !== 'undefined') { |
| 1024 | if (route.data) { |
| 1025 | try { |
| 1026 | route.children = JSON5.parse(route.data); |
| 1027 | delete route.data; |
| 1028 | route.kind = 'module'; |
| 1029 | _rawModule.children.push(route); |
| 1030 | } catch (parseError) { |
| 1031 | logger.warn( |
| 1032 | `Failed to parse route data for module "${mod.children[z].name}". ` + |
| 1033 | `Skipping route parsing for this module.` |
| 1034 | ); |
| 1035 | logger.debug(`Route data: ${route.data}`); |
| 1036 | logger.debug(`Parse error: ${parseError.message}`); |
| 1037 | // Skip this route but continue processing others |
| 1038 | } |
| 1039 | } |
| 1040 | } |
| 1041 | } |
| 1042 | } else { |
| 1043 | const route = this.foundRouteWithModuleName(mod.name); |
| 1044 | if (typeof route !== 'undefined') { |
| 1045 | if (route.data) { |
| 1046 | try { |
| 1047 | route.children = JSON5.parse(route.data); |
| 1048 | delete route.data; |
| 1049 | route.kind = 'module'; |
| 1050 | _rawModule.children.push(route); |
| 1051 | } catch (parseError) { |
| 1052 | logger.warn( |
| 1053 | `Failed to parse route data for module "${mod.name}". ` + |
| 1054 | `Skipping route parsing for this module.` |
| 1055 | ); |
| 1056 | logger.debug(`Route data: ${route.data}`); |
| 1057 | logger.debug(`Parse error: ${parseError.message}`); |
| 1058 | // Skip this route but continue processing others |
| 1059 | } |
| 1060 | } |
| 1061 | } |
| 1062 | } |
| 1063 | }; |
| 1064 | |
| 1065 | const loopRoutesParser = route => { |
| 1066 | if (route.children) { |
nothing calls this directly
no test coverage detected