Cartesian
Computes the cartesian product of arrays provided by an array or an object
Install
npm install cartesian --save
Examples
var cartesian = ;
Array or arrays:
; // =>// [// [ 'A', 'M', 'X', 'Z' ],// [ 'A', 'M', 'Y', 'Z' ],// [ 'B', 'M', 'X', 'Z' ],// [ 'B', 'M', 'Y', 'Z' ],// [ 'C', 'M', 'X', 'Z' ],// [ 'C', 'M', 'Y', 'Z' ]// ]
Object with array properties:
; // =>// [// { cdn: 'image1', path: '/dir', files: 'file1' },// { cdn: 'image1', path: '/dir', files: 'file2' },// { cdn: 'image1', path: '/dir', files: 'file3' },// { cdn: 'image2', path: '/dir', files: 'file1' },// { cdn: 'image2', path: '/dir', files: 'file2' },// { cdn: 'image2', path: '/dir', files: 'file3' }// ]
For more examples check out test.js
.