Skip to content

ruffle1986/compute-product

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

compute-product

Coverage Status Build Status

Computes the cartesian product of the given list of subsets.

According to the performance tests with matcha, it's faster than cartesian-product if you work with non-integer subsets like string or object arrays.

It's even faster when it's written in es5 but I wanted to implement it in es6.

Install

$ npm i -g compute-product

Usage

import product from 'compute-product'

product([[1, 2], [4, 5]]) // [[1, 4], [1, 5], [2, 4], [2, 5]]

Benchmark

$ npm run bench

Tests

$ npm test

Build

$ npm run build

Contributing

If you have any idea about how to make it faster, pull requests are welcome. ;)

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published