Socket
Socket
Sign inDemoInstall

compute-product

Package Overview
Dependencies
1
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    compute-product

Computes the cartesian product of the given list of sets.


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Install size
741 kB
Created
Weekly downloads
 

Readme

Source

compute-product

Computes the cartesian product of the given list of subsets.

According to the performance tests with (matcha)[https://www.npmjs.com/package/matcha], it's faster than (cartesian-product)[https://www.npmjs.com/package/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)[LICENSE]

Keywords

FAQs

Last updated on 08 Sep 2015

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc