node_modules/@graphql-tools/utils/index.cjs.js
/**
 * Given an AsyncIterable and a callback function, return an AsyncIterator
 * which produces values mapped via calling the callback function.
 */
Given an AsyncIterable and a callback function, return an AsyncIterator
which produces values mapped via calling the callback function.
Given an AsyncIterable and a callback function return an AsyncIterator which produces values mapped via calling the callback function .
function mapAsyncIterator(iterator, callback, rejectCallback) {
    let $return;
    let abruptClose;
    if (typeof iterator.return === 'function') {
        $return = iterator.return;
        abruptClose = (error) => {
            const rethrow = () => Promise.reject(error);
            return $return.call(iterator).then(rethrow, rethrow);
        };
    }
    function mapResult(result) {
        return result.done ? result : asyncMapValue(result.value, callback).then(iteratorResult, abruptClose);
    }
    let mapReject;
    if (rejectCallback) {
        const reject = rejectCallback;
        mapReject = (error) => asyncMapValue(error, reject).then(iteratorResult, abruptClose);
    }
    return {
        next() {
            return iterator.next().then(mapResult, mapReject);
        },
        return() {
            return $return
                ? $return.call(iterator).then(mapResult, mapReject)
                : Promise.resolve({ value: undefined, done: true });
        },
        throw(error) {
            if (typeof iterator.throw === 'function') {
                return iterator.throw(error).then(mapResult, mapReject);
            }
            return Promise.reject(error).catch(abruptClose);
        },
        [Symbol.asyncIterator]() {
            return this;
        },
    };
}
function mapAsyncIterator ( iterator , callback , rejectCallback ) { let $return ; let abruptClose ; if ( typeof iterator . return === 'function' ) { $return = iterator . return ; abruptClose = ( error ) => { const rethrow = ( ) => Promise . reject ( error ) ; return $return . call ( iterator ) . then ( rethrow , rethrow ) ; } ; } function mapResult ( result ) { return result . done ? result : asyncMapValue ( result . value , callback ) . then ( iteratorResult , abruptClose ) ; } let mapReject ; if ( rejectCallback ) { const reject = rejectCallback ; mapReject = ( error ) => asyncMapValue ( error , reject ) . then ( iteratorResult , abruptClose ) ; } return { next ( ) { return iterator . next ( ) . then ( mapResult , mapReject ) ; } , return ( ) { return $return ? $return . call ( iterator ) . then ( mapResult , mapReject ) : Promise . resolve ( { value : undefined , done : true } ) ; } , throw ( error ) { if ( typeof iterator . throw === 'function' ) { return iterator . throw ( error ) . then ( mapResult , mapReject ) ; } return Promise . reject ( error ) . catch ( abruptClose ) ; } , [ Symbol . asyncIterator ] ( ) { return this ; } , } ; }
Given an AsyncIterable and a callback function, return an AsyncIterator
 which produces values mapped via calling the callback function.
Given an AsyncIterable and a callback function return an AsyncIterator which produces values mapped via calling the callback function .
// Capture rejectCallback to ensure it cannot be null.