function mapAsyncIterator(iterable, callback) {
  var iterator = (0, _iterall.getAsyncIterator)(iterable);
  var $return = void 0;
  var abruptClose = void 0;
  if (typeof iterator.return === 'function') {
    $return = iterator.return;
    abruptClose = function abruptClose(error) {
      var rethrow = function rethrow() {
        return Promise.reject(error);
      };
      return $return.call(iterator).then(rethrow, rethrow);
    };
  }

  function mapResult(result) {
    return result.done ? result : asyncMapValue(result.value, callback).then(iteratorResult, abruptClose);
  }

  return _defineProperty({
    next: function next() {
      return iterator.next().then(mapResult);
    },
    return: function _return() {
      return $return ? $return.call(iterator).then(mapResult) : Promise.resolve({ value: undefined, done: true });
    },
    throw: function _throw(error) {
      if (typeof iterator.throw === 'function') {
        return iterator.throw(error).then(mapResult);
      }
      return Promise.reject(error).catch(abruptClose);
    }
  }, _iterall.$$asyncIterator, function () {
    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.
Given an AsyncIterable and a callback function return an AsyncIterator which produces values mapped via calling the callback function .
function mapAsyncIterator(iterable, callback) {
  var iterator = (0, _iterall.getAsyncIterator)(iterable);
  var $return = void 0;
  var abruptClose = void 0;
  if (typeof iterator.return === 'function') {
    $return = iterator.return;
    abruptClose = function abruptClose(error) {
      var rethrow = function rethrow() {
        return Promise.reject(error);
      };
      return $return.call(iterator).then(rethrow, rethrow);
    };
  }
  function mapResult(result) {
    return result.done ? result : asyncMapValue(result.value, callback).then(iteratorResult, abruptClose);
  }
  return _defineProperty({
    next: function next() {
      return iterator.next().then(mapResult);
    },
    return: function _return() {
      return $return ? $return.call(iterator).then(mapResult) : Promise.resolve({ value: undefined, done: true });
    },
    throw: function _throw(error) {
      if (typeof iterator.throw === 'function') {
        return iterator.throw(error).then(mapResult);
      }
      return Promise.reject(error).catch(abruptClose);
    }
  }, _iterall.$$asyncIterator, function () {
    return this;
  });
}
function mapAsyncIterator ( iterable , callback ) { var iterator = ( 0 , _iterall . getAsyncIterator ) ( iterable ) ; var $return = void 0 ; var abruptClose = void 0 ; if ( typeof iterator . return === 'function' ) { $return = iterator . return ; abruptClose = function abruptClose ( error ) { var rethrow = function rethrow ( ) { return Promise . reject ( error ) ; } ; return $return . call ( iterator ) . then ( rethrow , rethrow ) ; } ; } function mapResult ( result ) { return result . done ? result : asyncMapValue ( result . value , callback ) . then ( iteratorResult , abruptClose ) ; } return _defineProperty ( { next : function next ( ) { return iterator . next ( ) . then ( mapResult ) ; } , return : function _return ( ) { return $return ? $return . call ( iterator ) . then ( mapResult ) : Promise . resolve ( { value : undefined , done : true } ) ; } , throw : function _throw ( error ) { if ( typeof iterator . throw === 'function' ) { return iterator . throw ( error ) . then ( mapResult ) ; } return Promise . reject ( error ) . catch ( abruptClose ) ; } } , _iterall . $$asyncIterator , function ( ) { 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 .