summaryrefslogtreecommitdiff
path: root/tools/node_modules/eslint/node_modules/rxjs/src/internal/operators/reduce.ts
diff options
context:
space:
mode:
Diffstat (limited to 'tools/node_modules/eslint/node_modules/rxjs/src/internal/operators/reduce.ts')
-rw-r--r--tools/node_modules/eslint/node_modules/rxjs/src/internal/operators/reduce.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/node_modules/eslint/node_modules/rxjs/src/internal/operators/reduce.ts b/tools/node_modules/eslint/node_modules/rxjs/src/internal/operators/reduce.ts
index 9820dd47b7..a627dfb4ef 100644
--- a/tools/node_modules/eslint/node_modules/rxjs/src/internal/operators/reduce.ts
+++ b/tools/node_modules/eslint/node_modules/rxjs/src/internal/operators/reduce.ts
@@ -71,8 +71,9 @@ export function reduce<T, R>(accumulator: (acc: R, value: T, index?: number) =>
};
}
return function reduceOperatorFunction(source: Observable<T>): Observable<R> {
- return pipe(scan<T, T | R>((acc, value, index) => {
- return accumulator(<R>acc, value, index + 1);
- }), takeLast(1))(source) as Observable<R>;
+ return pipe(
+ scan((acc: R, value: T, index: number): R => accumulator(acc, value, index + 1)),
+ takeLast(1),
+ )(source);
};
}