UNPKG

jest-extended-snapshot

Version:
20 lines 656 B
"use strict"; 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