diff --git a/packages/rxjs/spec-dtslint/operators/every-spec.ts b/packages/rxjs/spec-dtslint/operators/every-spec.ts index 87c2e556af..04d07198a7 100644 --- a/packages/rxjs/spec-dtslint/operators/every-spec.ts +++ b/packages/rxjs/spec-dtslint/operators/every-spec.ts @@ -45,18 +45,3 @@ it('should handle the Boolean constructor', () => { const d = of(NaN, NaN, NaN).pipe(every(Boolean)); // $ExpectType Observable const e = of(0, 1, 0).pipe(every(Boolean)); // $ExpectType Observable }) - -it('should support this', () => { - const thisArg = { limit: 5 }; - const a = of(1, 2, 3).pipe(every(function (val) { - const limit = this.limit; // $ExpectType number - return val < limit; - }, thisArg)); -}); - -it('should deprecate thisArg usage', () => { - const a = of(1, 2, 3).pipe(every(Boolean)); // $ExpectNoDeprecation - const b = of(1, 2, 3).pipe(every(Boolean, {})); // $ExpectDeprecation - const c = of(1, 2, 3).pipe(every((value) => Boolean(value))); // $ExpectNoDeprecation - const d = of(1, 2, 3).pipe(every((value) => Boolean(value), {})); // $ExpectDeprecation -}); \ No newline at end of file diff --git a/packages/rxjs/spec-dtslint/operators/expand-spec.ts b/packages/rxjs/spec-dtslint/operators/expand-spec.ts index edba34e0a0..c117bea5f1 100644 --- a/packages/rxjs/spec-dtslint/operators/expand-spec.ts +++ b/packages/rxjs/spec-dtslint/operators/expand-spec.ts @@ -1,51 +1,47 @@ -import { of, asyncScheduler } from 'rxjs'; -import { expand } from 'rxjs/operators'; - -it('should infer correctly', () => { - const o = of(1, 2, 3).pipe(expand(value => of(value))); // $ExpectType Observable - const p = of(1, 2, 3).pipe(expand(value => [value])); // $ExpectType Observable - const q = of(1, 2, 3).pipe(expand(value => Promise.resolve(value))); // $ExpectType Observable -}); - -it('should infer correctly with a different type as the source', () => { - const o = of(1, 2, 3).pipe(expand(value => of('foo'))); // $ExpectType Observable - const p = of(1, 2, 3).pipe(expand(value => ['foo'])); // $ExpectType Observable - const q = of(1, 2, 3).pipe(expand(value => Promise.resolve('foo'))); // $ExpectType Observable -}); - -it('should support a project function with index', () => { - const o = of(1, 2, 3).pipe(expand((value, index) => of(index))); // $ExpectType Observable -}); - -it('should support concurrent parameter', () => { - const o = of(1, 2, 3).pipe(expand(value => of(1), 47)); // $ExpectType Observable -}); - -it('should support a scheduler', () => { - const o = of(1, 2, 3).pipe(expand(value => of(1), 47, asyncScheduler)); // $ExpectType Observable -}); - -it('should enforce types', () => { - const o = of(1, 2, 3).pipe(expand()); // $ExpectError -}); - -it('should enforce project types', () => { - const o = of(1, 2, 3).pipe(expand((value: string, index) => of(1))); // $ExpectError - const p = of(1, 2, 3).pipe(expand((value, index: string) => of(1))); // $ExpectError -}); - -it('should enforce project return type', () => { - const o = of(1, 2, 3).pipe(expand(value => 1)); // $ExpectError -}); - -it('should enforce concurrent type', () => { - const o = of(1, 2, 3).pipe(expand(value => of(1), 'foo')); // $ExpectError -}); - -it('should enforce scheduler type', () => { - const o = of(1, 2, 3).pipe(expand(value => of(1), 47, 'foo')); // $ExpectError -}); - -it('should support union types', () => { - const o = of(1).pipe(expand(x => typeof x === 'string' ? of(123) : of('test'))); // $ExpectType Observable -}); +import { of, asyncScheduler } from 'rxjs'; +import { expand } from 'rxjs/operators'; + +it('should infer correctly', () => { + const o = of(1, 2, 3).pipe(expand(value => of(value))); // $ExpectType Observable + const p = of(1, 2, 3).pipe(expand(value => [value])); // $ExpectType Observable + const q = of(1, 2, 3).pipe(expand(value => Promise.resolve(value))); // $ExpectType Observable +}); + +it('should infer correctly with a different type as the source', () => { + const o = of(1, 2, 3).pipe(expand(value => of('foo'))); // $ExpectType Observable + const p = of(1, 2, 3).pipe(expand(value => ['foo'])); // $ExpectType Observable + const q = of(1, 2, 3).pipe(expand(value => Promise.resolve('foo'))); // $ExpectType Observable +}); + +it('should support a project function with index', () => { + const o = of(1, 2, 3).pipe(expand((value, index) => of(index))); // $ExpectType Observable +}); + +it('should support concurrent parameter', () => { + const o = of(1, 2, 3).pipe(expand(value => of(1), 47)); // $ExpectType Observable +}); + +it('should enforce types', () => { + const o = of(1, 2, 3).pipe(expand()); // $ExpectError +}); + +it('should enforce project types', () => { + const o = of(1, 2, 3).pipe(expand((value: string, index) => of(1))); // $ExpectError + const p = of(1, 2, 3).pipe(expand((value, index: string) => of(1))); // $ExpectError +}); + +it('should enforce project return type', () => { + const o = of(1, 2, 3).pipe(expand(value => 1)); // $ExpectError +}); + +it('should enforce concurrent type', () => { + const o = of(1, 2, 3).pipe(expand(value => of(1), 'foo')); // $ExpectError +}); + +it('should enforce scheduler type', () => { + const o = of(1, 2, 3).pipe(expand(value => of(1), 47, 'foo')); // $ExpectError +}); + +it('should support union types', () => { + const o = of(1).pipe(expand(x => typeof x === 'string' ? of(123) : of('test'))); // $ExpectType Observable +}); diff --git a/packages/rxjs/src/internal/operators/every.ts b/packages/rxjs/src/internal/operators/every.ts index 311c215097..c41b05c5b4 100644 --- a/packages/rxjs/src/internal/operators/every.ts +++ b/packages/rxjs/src/internal/operators/every.ts @@ -25,7 +25,6 @@ export function every(predicate: (value: T, index: number) => boolean): Opera * ``` * * @param predicate A function for determining if an item meets a specified condition. - * @param thisArg Optional object to use for `this` in the callback. * @return A function that returns an Observable of booleans that determines if * all items of the source Observable meet the condition specified. */ diff --git a/packages/rxjs/src/internal/operators/expand.ts b/packages/rxjs/src/internal/operators/expand.ts index c3ec404f5e..03f214514e 100644 --- a/packages/rxjs/src/internal/operators/expand.ts +++ b/packages/rxjs/src/internal/operators/expand.ts @@ -50,8 +50,6 @@ export function expand>( * or the output Observable, returns an Observable. * @param concurrent Maximum number of input Observables being subscribed to * concurrently. - * @param scheduler The {@link SchedulerLike} to use for subscribing to - * each projected inner Observable. * @return A function that returns an Observable that emits the source values * and also result of applying the projection function to each value emitted on * the output Observable and merging the results of the Observables obtained