Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

仓库 files navigation

@codecb/iterator

🌡 An implementation of the Iterator helpers proposal.

Note: This implementation does not strictly follow the proposal. It creates a new base class and works on interfaces (Iterator, AsyncIterator, Iterable, and AsyncIterable) rather than inheriting from the real, native %IteratorPrototype% object which is quite awkward to access.

The interesting aspect of this project is it uses Generator and AsyncGenerator which makes it super easy to handle iteration operations comparing to writing a next function ourselves.

See test cases to have a taste of what these helpers do and how to use them.

References

  1. [GitHub] tc39/proposal-iterator-helpers
  2. [tc39.es] Iterator Helpers
  3. [2ality] ECMAScript proposal: iterator helpers
  4. [GitHub] nvie/itertools.js
  5. [GitHub] more-itertools/more-itertools
  6. [Rust] Trait std::iter::Iterator
  7. [Python] itertools — Functions creating iterators for efficient looping

关于

🌡 An implementation of the Iterator helpers proposal

Topics

Resources

Stars

2 stars

关注者

1 watching

复刻s

发布

贡献者

Languages