jest-extended-snapshot
Version:
Additional Jest matchers for snapshot testing
20 lines • 656 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
function getAllCombinations(paramsList = []) {
if (paramsList.length === 0) {
return [];
}
const [firstParams, ...rest] = paramsList;
if (rest.length === 0) {
return firstParams.map((param) => [param]);
}
const combinations = [];
getAllCombinations(rest).forEach((restCombination) => {
firstParams.forEach((param) => {
combinations.push([param].concat(restCombination));
});
});
return combinations;
}
exports.getAllCombinations = getAllCombinations;
//# sourceMappingURL=get-all-combinations.js.map