]> git.ipfire.org Git - thirdparty/vuejs/create-vue.git/commitdiff
chore: adjust the function name and comment a little bit
authorHaoqun Jiang <haoqunjiang@gmail.com>
Thu, 9 Sep 2021 12:46:28 +0000 (20:46 +0800)
committerHaoqun Jiang <haoqunjiang@gmail.com>
Thu, 9 Sep 2021 12:46:28 +0000 (20:46 +0800)
snapshot.js

index 7ea2cbf81176690dcbce0426a9cacb5b7e8a2f2b..ef7aa7214595ccbdb864a5993d9fa52f817f5e5c 100644 (file)
@@ -13,11 +13,10 @@ function createProjectWithFeatureFlags(flags) {
 
 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:
@@ -29,6 +28,7 @@ function getCombinations(arr) {
   // [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++) {
@@ -42,7 +42,7 @@ function getCombinations(arr) {
   return combinations
 }
 
-const flagCombinations = getCombinations(featureFlags)
+const flagCombinations = fullCombination(featureFlags)
 flagCombinations.push(['default'])
 
 for (const flags of flagCombinations) {