@@ -13,11 +13,10 @@ function createProjectWithFeatureFlags(flags) {
13
13
14
14
const featureFlags = [ 'typescript' , 'jsx' , 'router' , 'vuex' , 'with-tests' ]
15
15
16
- function getCombinations ( arr ) {
16
+ // The following code & comments are generated by GitHub CoPilot.
17
+ function fullCombination ( arr ) {
17
18
const combinations = [ ]
18
19
19
- // The following code & comments are generated by GitHub CoPilot.
20
-
21
20
// for an array of 5 elements, there are 2^5 - 1= 31 combinations
22
21
// (excluding the empty combination)
23
22
// equivalent to the following:
@@ -29,6 +28,7 @@ function getCombinations(arr) {
29
28
// [0, 0, 0, 0, 1] = 0b0001
30
29
// [1, 1, 1, 1, 1] = 0b1111
31
30
31
+ // Note we need to exclude the empty comination in our case
32
32
for ( let i = 1 ; i < 1 << arr . length ; i ++ ) {
33
33
const combination = [ ]
34
34
for ( let j = 0 ; j < arr . length ; j ++ ) {
@@ -42,7 +42,7 @@ function getCombinations(arr) {
42
42
return combinations
43
43
}
44
44
45
- const flagCombinations = getCombinations ( featureFlags )
45
+ const flagCombinations = fullCombination ( featureFlags )
46
46
flagCombinations . push ( [ 'default' ] )
47
47
48
48
for ( const flags of flagCombinations ) {
0 commit comments