dist/async-iterable/operators.js
/** Skip items in an iterable until the passed predicate fails, then yield all items in the iterable */
Skip items in an iterable until the passed predicate fails, then yield all items in the iterable
Skip items in an iterable until the passed predicate fails then yield all items in the iterable
function skipWhile(predicate) {
    return function (iterable) {
        return __asyncGenerator(this, arguments, function* () {
            var e_17, _a;
            let i = 0;
            let canReturn = false;
            try {
                for (var iterable_15 = __asyncValues(iterable), iterable_15_1; iterable_15_1 = yield __await(iterable_15.next()), !iterable_15_1.done;) {
                    const item = iterable_15_1.value;
                    if (!canReturn) {
                        canReturn = !(yield __await(Promise.resolve(predicate(item, i))));
                        if (canReturn) {
                            yield yield __await(item);
                        }
                        i = i + 1;
                    }
                    else {
                        yield yield __await(item);
                    }
                }
            }
            catch (e_17_1) { e_17 = { error: e_17_1 }; }
            finally {
                try {
                    if (iterable_15_1 && !iterable_15_1.done && (_a = iterable_15.return)) yield __await(_a.call(iterable_15));
                }
                finally { if (e_17) throw e_17.error; }
            }
        });
    };
}
function skipWhile ( predicate ) { return function ( iterable ) { return __asyncGenerator ( this , arguments , function * ( ) { var e_17 , _a ; let i = 0 ; let canReturn = false ; try { for ( var iterable_15 = __asyncValues ( iterable ) , iterable_15_1 ; iterable_15_1 = yield __await ( iterable_15 . next ( ) ) , ! iterable_15_1 . done ; ) { const item = iterable_15_1 . value ; if ( ! canReturn ) { canReturn = ! ( yield __await ( Promise . resolve ( predicate ( item , i ) ) ) ) ; if ( canReturn ) { yield yield __await ( item ) ; } i = i + 1 ; } else { yield yield __await ( item ) ; } } } catch ( e_17_1 ) { e_17 = { error : e_17_1 } ; } finally { try { if ( iterable_15_1 && ! iterable_15_1 . done && ( _a = iterable_15 . return ) ) yield __await ( _a . call ( iterable_15 ) ) ; } finally { if ( e_17 ) throw e_17 . error ; } } } ) ; } ; }
Skip items in an iterable until the passed predicate fails, then yield all items in the iterable
Skip items in an iterable until the passed predicate fails then yield all items in the iterable