We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f039a35 commit d27138aCopy full SHA for d27138a
src/operator/if-truthy.operator.ts
@@ -1,11 +1,11 @@
1
-import { filter } from 'rxjs/operators';
2
-import { MonoTypeOperatorFunction, Observable } from 'rxjs';
+import {Observable, OperatorFunction} from 'rxjs';
+import {filter} from 'rxjs/operators';
3
4
/**
5
* filter !!value
6
*/
7
-export function ifTruthy<I>(): MonoTypeOperatorFunction<I> {
+export function ifTruthy<I>(): OperatorFunction<NonNullable<I> | null | undefined, NonNullable<I>> {
8
return (source$: Observable<I>) => source$.pipe(
9
- filter((input: I) => !!input)
+ filter((input: I | null | undefined): input is NonNullable<I> => !!input)
10
);
11
}
0 commit comments