Skip to content

Commit

Permalink
Commit all resources
Browse files Browse the repository at this point in the history
  • Loading branch information
mesmo committed Sep 30, 2024
1 parent 299d19a commit 8620991
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/node/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ exports.criteria = criteria;
// the implementation of pivot
function pivot(source, ...[dimension, ...dimensions]) {
const matrix = dimension.map((criteria) => {
const filtered = [];
const slice = [];
for (var value of source) {
if (criteria(value)) {
filtered.push(value);
slice.push(value);
}
}
return filtered;
return slice;
});
// recurse if there are other dimensions, otherwise just return the matrix
return dimensions.length ? matrix.map(slice => pivot(slice, ...dimensions)) : matrix;
Expand Down

0 comments on commit 8620991

Please sign in to comment.