Skip to content

Commit d2d02f7

Browse files
committed
more consistent scope preference order
1 parent 156d985 commit d2d02f7

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

src/featureToggles.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,29 +68,38 @@ const COMPONENT_NAME = "/FeatureToggles";
6868
const VERROR_CLUSTER_NAME = "FeatureTogglesError";
6969

7070
const SCOPE_PREFERENCE_ORDER_MASKS = [
71-
[parseInt("10", 2), parseInt("01", 2)],
7271
[
72+
// choose 1 of 2
73+
parseInt("10", 2),
74+
parseInt("01", 2),
75+
],
76+
[
77+
// choose 2 of 3
7378
parseInt("110", 2),
7479
parseInt("101", 2),
7580
parseInt("011", 2),
7681

82+
// choose 1 of 3
7783
parseInt("100", 2),
7884
parseInt("010", 2),
7985
parseInt("001", 2),
8086
],
8187
[
88+
// choose 3 of 4
8289
parseInt("1110", 2),
8390
parseInt("1101", 2),
8491
parseInt("1011", 2),
8592
parseInt("0111", 2),
8693

94+
// choose 2 of 4
8795
parseInt("1100", 2),
8896
parseInt("1010", 2),
8997
parseInt("1001", 2),
90-
parseInt("0101", 2),
9198
parseInt("0110", 2),
99+
parseInt("0101", 2),
92100
parseInt("0011", 2),
93101

102+
// choose 1 of 4
94103
parseInt("1000", 2),
95104
parseInt("0100", 2),
96105
parseInt("0010", 2),

test/featureToggles.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ describe("feature toggles test", () => {
118118
"label::l1##tenantId::t1",
119119
"bla::b1##tenantId::t1",
120120
"naa::n1##tenantId::t1",
121-
"label::l1##naa::n1",
122121
"bla::b1##label::l1",
122+
"label::l1##naa::n1",
123123
"bla::b1##naa::n1",
124124
"tenantId::t1",
125125
"label::l1",

0 commit comments

Comments
 (0)