(host: Tree, filePath: string, symbolName: string, moduleName: string)
| 160 | export default serviceWorkerSchematic; |
| 161 | |
| 162 | function addImport(host: Tree, filePath: string, symbolName: string, moduleName: string): void { |
| 163 | const moduleSource = getTsSourceFile(host, filePath); |
| 164 | const change = insertImport(moduleSource, filePath, symbolName, moduleName); |
| 165 | |
| 166 | if (change) { |
| 167 | const recorder = host.beginUpdate(filePath); |
| 168 | applyToUpdateRecorder(recorder, [change]); |
| 169 | host.commitUpdate(recorder); |
| 170 | } |
| 171 | } |
no test coverage detected