Buckets:
| ; | |
| Object.defineProperty(exports, "__esModule", { value: true }); | |
| exports.createFind = exports.find = void 0; | |
| var lift_1 = require("../util/lift"); | |
| var OperatorSubscriber_1 = require("./OperatorSubscriber"); | |
| function find(predicate, thisArg) { | |
| return lift_1.operate(createFind(predicate, thisArg, 'value')); | |
| } | |
| exports.find = find; | |
| function createFind(predicate, thisArg, emit) { | |
| var findIndex = emit === 'index'; | |
| return function (source, subscriber) { | |
| var index = 0; | |
| source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function (value) { | |
| var i = index++; | |
| if (predicate.call(thisArg, value, i, source)) { | |
| subscriber.next(findIndex ? i : value); | |
| subscriber.complete(); | |
| } | |
| }, function () { | |
| subscriber.next(findIndex ? -1 : undefined); | |
| subscriber.complete(); | |
| })); | |
| }; | |
| } | |
| exports.createFind = createFind; | |
| //# sourceMappingURL=find.js.map |
Xet Storage Details
- Size:
- 1 kB
- Xet hash:
- 786f52e69b8eef9ccc1a02c75d10a89b1c387cb542700404f4a7190274739d27
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.