code: function toIterator(generator, {indexed = false, kv = false} = {}) {
      return {
          [Symbol.iterator]() {
              return this;
          },
          next() {
              const {value, done} = generator.next();
              this.index = done ? this.index : this.index != null ? this.index + 1 : 0;
              return indexed ? {value: kv ? [this.index, value] : [value, this.index], done} : {value, done};
          }
      };
  }
docs: ***************** [ Iterators ] ****************** 
  Generator <-> Iterator compatibility corner case workaround
  
  when a generator (say of 10 values) is partially destructured, it prematurely terminates
  example:
  ```
  const [a, b] = generator; // generator has more than two values
  generator.next(); // {done: true, value: undefined}
  
  // while an iterator resumes as expected
  
  const [a, b] = iterator; // iterator has more than two values
  iterator.next(); // {done: false, value: nextValue}
  ```
  @param generator
  @returns {Iterator}