dist/async-iterable/operators.js
/** Take only the first item in an iterable sequence */
Take only the first item in an iterable sequence
Take only the first item in an iterable sequence
async function first(iterable) {
    var e_13, _a;
    try {
        for (var iterable_11 = __asyncValues(iterable), iterable_11_1; iterable_11_1 = await iterable_11.next(), !iterable_11_1.done;) {
            const item = iterable_11_1.value;
            return item;
        }
    }
    catch (e_13_1) { e_13 = { error: e_13_1 }; }
    finally {
        try {
            if (iterable_11_1 && !iterable_11_1.done && (_a = iterable_11.return)) await _a.call(iterable_11);
        }
        finally { if (e_13) throw e_13.error; }
    }
    return undefined;
}
async function first ( iterable ) { var e_13 , _a ; try { for ( var iterable_11 = __asyncValues ( iterable ) , iterable_11_1 ; iterable_11_1 = await iterable_11 . next ( ) , ! iterable_11_1 . done ; ) { const item = iterable_11_1 . value ; return item ; } } catch ( e_13_1 ) { e_13 = { error : e_13_1 } ; } finally { try { if ( iterable_11_1 && ! iterable_11_1 . done && ( _a = iterable_11 . return ) ) await _a . call ( iterable_11 ) ; } finally { if ( e_13 ) throw e_13 . error ; } } return undefined ; }
Take only the first item in an iterable sequence
Take only the first item in an iterable sequence