@@ -23,7 +23,7 @@ export class RouterParserUtil {
2323 private cleanModulesTree ;
2424 private modulesWithRoutes = [ ] ;
2525 private transformAngular8ImportSyntax =
26- / ( [ ' " ] l o a d C h i l d r e n [ ' " ] : ) \( \) = > " i m p o r t \( ( \\ ' | ' | " ) ( [ ^ ' " ] + ?) ( \\ ' | ' | " ) \) \. t h e n \( \w + ?= > \S + ?\. ( [ ^ ) ] + ?) \) ( \\ ' | ' | " ) / g;
26+ / ( [ ' " ] l o a d C h i l d r e n [ ' " ] : ) \( \) ( : [ ^ ) ] + ? ) ? = > " i m p o r t \( ( \\ ' | ' | " ) ( [ ^ ' " ] + ?) ( \\ ' | ' | " ) \) \. t h e n \( \( ? \w + ? \) ? = > \S + ?\. ( [ ^ ) ] + ?) \) ( \\ ' | ' | " ) / g;
2727
2828 private static instance : RouterParserUtil ;
2929 private constructor ( ) { }
@@ -63,14 +63,14 @@ export class RouterParserUtil {
6363
6464 public cleanRawRouteParsed ( route : string ) : object {
6565 let routesWithoutSpaces = route . replace ( / / gm, '' ) ;
66- let testTrailingComma = routesWithoutSpaces . indexOf ( '},]' ) ;
66+ const testTrailingComma = routesWithoutSpaces . indexOf ( '},]' ) ;
6767 if ( testTrailingComma !== - 1 ) {
6868 routesWithoutSpaces = routesWithoutSpaces . replace ( '},]' , '}]' ) ;
6969 }
7070
7171 routesWithoutSpaces = routesWithoutSpaces . replace (
7272 this . transformAngular8ImportSyntax ,
73- '$1"$3#$5 "'
73+ '$1"$4#$6 "'
7474 ) ;
7575
7676 return JSON5 . parse ( routesWithoutSpaces ) ;
@@ -85,7 +85,7 @@ export class RouterParserUtil {
8585
8686 routesWithoutSpaces = routesWithoutSpaces . replace (
8787 this . transformAngular8ImportSyntax ,
88- '$1"$3#$5 "'
88+ '$1"$4#$6 "'
8989 ) ;
9090
9191 return routesWithoutSpaces ;
0 commit comments