refactor(service-worker): ensure compatibility with typescript strict flag (#30993)

As part of FW-1265, the `@angular/service-worker` package is made compatible
with the TypeScript `--strict` flag. Read more about the strict flag [here](https://www.typescriptlang.org/docs/handbook/compiler-options.html)

PR Close #30993
This commit is contained in:
Paul Gschwendtner 2019-06-13 21:48:51 +02:00 committed by Miško Hevery
parent 221cbd0b47
commit 69a612d402
1 changed files with 1 additions and 1 deletions

View File

@ -76,7 +76,7 @@ export class NgswCommChannel {
const currentController = defer(() => of (serviceWorker.controller));
const controllerWithChanges = concat(currentController, controllerChanges);
this.worker = controllerWithChanges.pipe(filter<ServiceWorker>(c => !!c));
this.worker = controllerWithChanges.pipe(filter((c): c is ServiceWorker => !!c));
this.registration = <Observable<ServiceWorkerRegistration>>(
this.worker.pipe(switchMap(() => serviceWorker.getRegistration())));