docs: 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};
          }
      };
  }