'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = FilterMap; var _Pipe = require('../sink/Pipe'); var _Pipe2 = _interopRequireDefault(_Pipe); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function FilterMap(p, f, source) { this.p = p; this.f = f; this.source = source; } /** @license MIT License (c) copyright 2010-2016 original author or authors */ /** @author Brian Cavalier */ /** @author John Hann */ FilterMap.prototype.run = function (sink, scheduler) { return this.source.run(new FilterMapSink(this.p, this.f, sink), scheduler); }; function FilterMapSink(p, f, sink) { this.p = p; this.f = f; this.sink = sink; } FilterMapSink.prototype.event = function (t, x) { var f = this.f; var p = this.p; p(x) && this.sink.event(t, f(x)); }; FilterMapSink.prototype.end = _Pipe2.default.prototype.end; FilterMapSink.prototype.error = _Pipe2.default.prototype.error;