const featureFlags = ['typescript', 'jsx', 'router', 'vuex', 'with-tests']
-function getCombinations(arr) {
+// The following code & comments are generated by GitHub CoPilot.
+function fullCombination(arr) {
const combinations = []
- // The following code & comments are generated by GitHub CoPilot.
-
// for an array of 5 elements, there are 2^5 - 1= 31 combinations
// (excluding the empty combination)
// equivalent to the following:
// [0, 0, 0, 0, 1] = 0b0001
// [1, 1, 1, 1, 1] = 0b1111
+ // Note we need to exclude the empty comination in our case
for (let i = 1; i < 1 << arr.length; i++) {
const combination = []
for (let j = 0; j < arr.length; j++) {
return combinations
}
-const flagCombinations = getCombinations(featureFlags)
+const flagCombinations = fullCombination(featureFlags)
flagCombinations.push(['default'])
for (const flags of flagCombinations) {