![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/vreg/node_modules/rxjs/_esm2015/internal/operators/ |
import { Subscriber } from '../Subscriber'; export function map(project, thisArg) { return function mapOperation(source) { if (typeof project !== 'function') { throw new TypeError('argument is not a function. Are you looking for `mapTo()`?'); } return source.lift(new MapOperator(project, thisArg)); }; } export class MapOperator { constructor(project, thisArg) { this.project = project; this.thisArg = thisArg; } call(subscriber, source) { return source.subscribe(new MapSubscriber(subscriber, this.project, this.thisArg)); } } class MapSubscriber extends Subscriber { constructor(destination, project, thisArg) { super(destination); this.project = project; this.count = 0; this.thisArg = thisArg || this; } _next(value) { let result; try { result = this.project.call(this.thisArg, value, this.count++); } catch (err) { this.destination.error(err); return; } this.destination.next(result); } } //# sourceMappingURL=map.js.map