(template: string)
| 126 | * determines if the CommonModule can be safely removed from imports |
| 127 | */ |
| 128 | export function canRemoveCommonModule(template: string): boolean { |
| 129 | const parsed = parseTemplate(template); |
| 130 | let removeCommonModule = false; |
| 131 | if (parsed.tree !== undefined) { |
| 132 | const visitor = new CommonCollector(); |
| 133 | visitAll(visitor, parsed.tree.rootNodes); |
| 134 | removeCommonModule = visitor.count === 0; |
| 135 | } |
| 136 | return removeCommonModule; |
| 137 | } |
| 138 | |
| 139 | /** Finds all non-control flow elements from common module. */ |
| 140 | class CommonCollector extends RecursiveVisitor { |
no test coverage detected
searching dependent graphs…