Skip to content

Commit f878294

Browse files
committed
chore: adjust the function name and comment a little bit
1 parent 5cd3399 commit f878294

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

snapshot.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,10 @@ function createProjectWithFeatureFlags(flags) {
1313

1414
const featureFlags = ['typescript', 'jsx', 'router', 'vuex', 'with-tests']
1515

16-
function getCombinations(arr) {
16+
// The following code & comments are generated by GitHub CoPilot.
17+
function fullCombination(arr) {
1718
const combinations = []
1819

19-
// The following code & comments are generated by GitHub CoPilot.
20-
2120
// for an array of 5 elements, there are 2^5 - 1= 31 combinations
2221
// (excluding the empty combination)
2322
// equivalent to the following:
@@ -29,6 +28,7 @@ function getCombinations(arr) {
2928
// [0, 0, 0, 0, 1] = 0b0001
3029
// [1, 1, 1, 1, 1] = 0b1111
3130

31+
// Note we need to exclude the empty comination in our case
3232
for (let i = 1; i < 1 << arr.length; i++) {
3333
const combination = []
3434
for (let j = 0; j < arr.length; j++) {
@@ -42,7 +42,7 @@ function getCombinations(arr) {
4242
return combinations
4343
}
4444

45-
const flagCombinations = getCombinations(featureFlags)
45+
const flagCombinations = fullCombination(featureFlags)
4646
flagCombinations.push(['default'])
4747

4848
for (const flags of flagCombinations) {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy