Code coverage report for cjs/operator/extended/find-support.js

Statements: 100% (47 / 47)      Branches: 82.35% (14 / 17)      Functions: 100% (10 / 10)      Lines: 100% (44 / 44)      Ignored: none     

All files » cjs/operator/extended/ » find-support.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 571 2 1 1   1 1 1 1 1 1 12 12 12 12   1 12   1   1 1 1 1 12 12 12 12 12 12 12     1 6 6 6   1 14 14 14 14 2   12 2     1 4   1   1  
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) Eif (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
var Subscriber_1 = require('../../Subscriber');
var tryCatch_1 = require('../../util/tryCatch');
var errorObject_1 = require('../../util/errorObject');
var bindCallback_1 = require('../../util/bindCallback');
var FindValueOperator = (function () {
    function FindValueOperator(predicate, source, yieldIndex, thisArg) {
        this.predicate = predicate;
        this.source = source;
        this.yieldIndex = yieldIndex;
        this.thisArg = thisArg;
    }
    FindValueOperator.prototype.call = function (observer) {
        return new FindValueSubscriber(observer, this.predicate, this.source, this.yieldIndex, this.thisArg);
    };
    return FindValueOperator;
})();
exports.FindValueOperator = FindValueOperator;
var FindValueSubscriber = (function (_super) {
    __extends(FindValueSubscriber, _super);
    function FindValueSubscriber(destination, predicate, source, yieldIndex, thisArg) {
        _super.call(this, destination);
        this.source = source;
        this.yieldIndex = yieldIndex;
        this.thisArg = thisArg;
        this.index = 0;
        Eif (typeof predicate === 'function') {
            this.predicate = bindCallback_1.bindCallback(predicate, thisArg, 3);
        }
    }
    FindValueSubscriber.prototype.notifyComplete = function (value) {
        var destination = this.destination;
        destination.next(value);
        destination.complete();
    };
    FindValueSubscriber.prototype._next = function (value) {
        var predicate = this.predicate;
        var index = this.index++;
        var result = tryCatch_1.tryCatch(predicate)(value, index, this.source);
        if (result === errorObject_1.errorObject) {
            this.destination.error(result.e);
        }
        else if (result) {
            this.notifyComplete(this.yieldIndex ? index : value);
        }
    };
    FindValueSubscriber.prototype._complete = function () {
        this.notifyComplete(this.yieldIndex ? -1 : undefined);
    };
    return FindValueSubscriber;
})(Subscriber_1.Subscriber);
exports.FindValueSubscriber = FindValueSubscriber;
//# sourceMappingURL=find-support.js.map