File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -147,6 +147,11 @@ export default class ContentFeature {
147
147
if ( ! domain ) return [ ]
148
148
const domains = this . _getFeatureSetting ( ) ?. [ featureKeyName ] || [ ]
149
149
return domains . filter ( ( rule ) => {
150
+ if ( Array . isArray ( rule . domain ) ) {
151
+ return rule . domain . some ( ( domainRule ) => {
152
+ return matchHostname ( domain , domainRule )
153
+ } )
154
+ }
150
155
return matchHostname ( domain , rule . domain )
151
156
} )
152
157
}
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ describe('Helpers checks', () => {
8
8
expect ( this . getFeatureSetting ( 'test' ) ) . toBe ( 'enabled3' )
9
9
expect ( this . getFeatureSetting ( 'otherTest' ) ) . toBe ( 'enabled' )
10
10
expect ( this . getFeatureSetting ( 'otherOtherTest' ) ) . toBe ( 'ding' )
11
+ expect ( this . getFeatureSetting ( 'arrayTest' ) ) . toBe ( 'enabledArray' )
11
12
didRun = true
12
13
}
13
14
}
@@ -21,6 +22,7 @@ describe('Helpers checks', () => {
21
22
test : 'enabled' ,
22
23
otherTest : 'disabled' ,
23
24
otherOtherTest : 'ding' ,
25
+ arrayTest : 'enabled' ,
24
26
domains : [
25
27
{
26
28
domain : 'example.com' ,
@@ -34,6 +36,12 @@ describe('Helpers checks', () => {
34
36
patchSettings : [
35
37
{ op : 'replace' , path : '/test' , value : 'enabled3' }
36
38
]
39
+ } ,
40
+ {
41
+ domain : [ 'meep.com' , 'example.com' ] ,
42
+ patchSettings : [
43
+ { op : 'replace' , path : '/arrayTest' , value : 'enabledArray' }
44
+ ]
37
45
}
38
46
]
39
47
}
You can’t perform that action at this time.
0 commit comments