angus-c/just

Permutations gives incorrect result for arrays of arrays

ChristopherChudzicki opened this issue · 0 comments

When permuting an array of arrays, the results are incorrect:

const permutations = require('just-permutations')
const results = permutations([[1], [2]]);
// result:
// [
//     [ 1, [ 2 ] ],          <--- should be [[1], [2]]
//     [ [ 2 ], 1 ]           <--- should be [[2], [1]]
// ]

Note that results[0][0] should be [1], but instead it is just 1.