Code coverage report for cjs/operators/scan.js

Statements: 91.04% (61 / 67)      Branches: 64.29% (18 / 28)      Functions: 100% (15 / 15)      Lines: 95.56% (43 / 45)      Ignored: none     

All files » cjs/operators/ » scan.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89    1   1   1   2   1   14   1   1   1   1   1   1 7     1 1 7   7 7     1 7     1     1 1   1 7   7 7 7 7 7         1 16       16 16 1   15 15         1     31     22 22       1     1  
'use strict';
 
exports.__esModule = true;
 
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; Iif ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { Eif (protoProps) defineProperties(Constructor.prototype, protoProps); Iif (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
 
exports['default'] = scan;
 
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }
 
function _inherits(subClass, superClass) { Iif (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); Eif (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
 
function _classCallCheck(instance, Constructor) { Iif (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }
 
var _Subscriber2 = require('../Subscriber');
 
var _Subscriber3 = _interopRequireDefault(_Subscriber2);
 
var _utilTryCatch = require('../util/tryCatch');
 
var _utilTryCatch2 = _interopRequireDefault(_utilTryCatch);
 
var _utilErrorObject = require('../util/errorObject');
 
function scan(project, acc) {
    return this.lift(new ScanOperator(project, acc));
}
 
var ScanOperator = (function () {
    function ScanOperator(project, acc) {
        _classCallCheck(this, ScanOperator);
 
        this.acc = acc;
        this.project = project;
    }
 
    ScanOperator.prototype.call = function call(subscriber) {
        return new ScanSubscriber(subscriber, this.project, this.acc);
    };
 
    return ScanOperator;
})();
 
var ScanSubscriber = (function (_Subscriber) {
    _inherits(ScanSubscriber, _Subscriber);
 
    function ScanSubscriber(destination, project, acc) {
        _classCallCheck(this, ScanSubscriber);
 
        _Subscriber.call(this, destination);
        this.accumulatorSet = false;
        this.acc = acc;
        this.project = project;
        this.accumulatorSet = typeof acc !== 'undefined';
    }
 
    //# sourceMappingURL=scan.js.map
 
    ScanSubscriber.prototype._next = function _next(x) {
        Iif (!this.accumulatorSet) {
            this.acc = x;
            this.destination.next(x);
        } else {
            var result = _utilTryCatch2['default'](this.project).call(this, this.acc, x);
            if (result === _utilErrorObject.errorObject) {
                this.destination.error(_utilErrorObject.errorObject.e);
            } else {
                this.acc = result;
                this.destination.next(this.acc);
            }
        }
    };
 
    _createClass(ScanSubscriber, [{
        key: 'acc',
        get: function get() {
            return this._acc;
        },
        set: function set(value) {
            this.accumulatorSet = true;
            this._acc = value;
        }
    }]);
 
    return ScanSubscriber;
})(_Subscriber3['default']);
 
module.exports = exports['default'];
//# sourceMappingURL=scan.js.map