Bamieh/reflow

View on GitHub
packages/reflow-core/lib/utils/cartesian.js

Summary

Maintainability
A
0 mins
Test Coverage
const f = (a, b) => [].concat(...a.map(d => b.map(e => [].concat(d, e))));
const cartesian = (a, b, ...c) => (b ? cartesian(f(a, b), ...c) : a);

module.exports = cartesian;