@@ -20,9 +20,10 @@ it('should support a predicate with inclusive option', () => {
20
20
it ( 'should properly support Boolean constructor' , ( ) => {
21
21
const a = of ( false as const , 0 as const , - 0 as const , 0n as const , '' as const , null , undefined ) . pipe ( takeWhile ( Boolean ) ) ; // $ExpectType Observable<never>
22
22
const b = of ( false as const , 0 as const , - 0 as const , 0n as const , '' as const , null , undefined ) . pipe ( takeWhile ( Boolean , true ) ) ; // $ExpectType Observable<false | "" | 0 | 0n | null | undefined>
23
- const c = of ( false as const , 0 as const , 'hi' as const , - 0 as const , 0n as const , '' as const , null , undefined ) . pipe ( takeWhile ( Boolean ) ) ; // $ExpectType Observable<false | "" | 0 | 0n | "hi" | null | undefined>
24
- const d = of ( false as const , 0 as const , 'hi' as const , - 0 as const , 0n as const , '' as const , null , undefined ) . pipe ( takeWhile ( Boolean , true ) ) ; // $ExpectType Observable<false | "" | 0 | 0n | "hi" | null | undefined>
25
- const e = of ( 1 , [ 'hi' ] , false as const , 0 as const , - 0 as const , 0n as const , '' as const , null , undefined ) . pipe ( takeWhile ( Boolean , true ) ) ; // $ExpectType Observable<number | false | "" | 0n | string[] | null | undefined>
23
+ const c = of ( false as const , 0 as const , 'hi' as const , - 0 as const , 0n as const , '' as const , null , undefined ) . pipe ( takeWhile ( Boolean ) ) ; // $ExpectType Observable<"hi">
24
+ const d = of ( false as const , 0 as const , 'hi' as const , - 0 as const , 0n as const , '' as const , null , undefined ) . pipe ( takeWhile ( Boolean , false ) ) ; // $ExpectType Observable<"hi">
25
+ const e = of ( false as const , 0 as const , 'hi' as const , - 0 as const , 0n as const , '' as const , null , undefined ) . pipe ( takeWhile ( Boolean , true ) ) ; // $ExpectType Observable<false | "" | 0 | 0n | "hi" | null | undefined>
26
+ const f = of ( 1 , [ 'hi' ] , false as const , 0 as const , - 0 as const , 0n as const , '' as const , null , undefined ) . pipe ( takeWhile ( Boolean , true ) ) ; // $ExpectType Observable<number | false | "" | 0n | string[] | null | undefined>
26
27
} ) ;
27
28
28
29
it ( 'should properly handle predicates that always return false' , ( ) => {
@@ -36,4 +37,4 @@ it('should support inference from a predicate that returns any', () => {
36
37
}
37
38
38
39
const o$ = of ( 1 ) . pipe ( takeWhile ( isTruthy ) ) ; // $ExpectType Observable<number>
39
- } ) ;
40
+ } ) ;
0 commit comments