(mainPath: string)
| 121 | // end helper functions. |
| 122 | |
| 123 | function validateProject(mainPath: string): Rule { |
| 124 | return (host: Tree) => { |
| 125 | const routerOutletCheckRegex = /<router-outlet.*?>([\s\S]*?)(?:<\/router-outlet>)?/; |
| 126 | |
| 127 | const componentPath = getBootstrapComponentPath(host, mainPath); |
| 128 | const tmpl = getComponentTemplateInfo(host, componentPath); |
| 129 | const template = getComponentTemplate(host, componentPath, tmpl); |
| 130 | if (!routerOutletCheckRegex.test(template)) { |
| 131 | throw new SchematicsException( |
| 132 | `Prerequisite for application shell is to define a router-outlet in your root component.`, |
| 133 | ); |
| 134 | } |
| 135 | }; |
| 136 | } |
| 137 | |
| 138 | function getMetadataProperty(metadata: ts.Node, propertyName: string): ts.PropertyAssignment { |
| 139 | const properties = (metadata as ts.ObjectLiteralExpression).properties; |
no test coverage detected