product-set-generator
v1.0.0
Published
cartesian product generator
Downloads
59
Maintainers
Readme
product-set-generator
Generator that receives an iterable of iterables as input and returns and iterator which iterates over array of elements of the cartesian product.
Install
npm install product-set-generator --save
Usage
const product-set-generator = require('product-set-generator')
const iterator = productSet([
[1, 2],
[3, 4]
])
iterator.next() // {value: [1, 3], done: false}
iterator.next() // {value: [2, 3], done: false}
iterator.next() // {value: [1, 4], done: false}
iterator.next() // {value: [2, 4], done: false}
iterator.next() // {done: true}
Support
- Node.js >=6
License
MIT