@syrflover/iterator
v0.5.0
Published
Iterator Helper for TypeScript
Maintainers
Readme
Iterator Helper
Iterator Helper used AsyncIterator
Contents
Installation
Node
npm install @syrflover/iteratorDeno
Install master branch (as latest)
deno install https://raw.githubusercontent.com/syrflover/iterator-helper/master/mod.tsFetch specified version
deno install https://raw.githubusercontent.com/syrflover/iterator-helper/v0.4.1/mod.tsUsage
Use constructor
// in browser or node
import { iterator } from '@syrflover/iterator';
// in deno
import { iterator } from 'https://raw.githubusercontent.com/syrflover/iterator-helper/master/mod.ts';
iterator([1, 2, 3, 4, 5, 6])
.filter((e) => e % 2 === 0)
.map((e) => e + 1)
.sum()
.then((r) => logger.info(r)); // 15Use ArrayLike.prototype.iter
// in browser or node
import '@syrflover/iterator/dist/types/global';
// in deno
import 'https://raw.githubusercontent.com/syrflover/iterator-helper/master/deno/types/global.ts';
[1, 2, 3, 4, 5, 6]
.iter()
.filter((e) => e % 2 === 0)
.map((e) => e + 1)
.sum()
.then((r) => logger.info(r)); // 15List of supported ArrayLike.prototype.iter
StringArrayInt8ArrayInt16ArrayInt32ArrayUint8ArrayUint8ClampedArrayUint16ArrayUint32ArrayFloat32ArrayFloat64Array
Path of internal modules
src
├── mod.ts
├── lib
│ ├── compare
│ │ └── mod.ts
│ ├── iterable
│ │ └── mod.ts
│ └── utils
│ └── mod.ts
├── methods
│ └── mod.ts
└── types
├── global.ts
├── mod.ts
├── functions
│ └── mod.ts
└── guards
└── mod.tsTypeDoc
Releases
References
- https://github.com/tc39/proposal-iterator-helpers
- https://doc.rust-lang.org/stable/std/iter/trait.Iterator.html
- https://hackage.haskell.org/package/base-4.12.0.0/docs/Data-List.html
