File tree 2 files changed +18
-6
lines changed
site/src/pages/DeploymentSettingsPage
2 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -120,6 +120,15 @@ describe("optionValue", () => {
120
120
additionalValues : [ "single_tailnet" ] ,
121
121
expected : { single_tailnet : true } ,
122
122
} ,
123
+ {
124
+ option : {
125
+ ...defaultOption ,
126
+ name : "Experiments" ,
127
+ value : null ,
128
+ } ,
129
+ additionalValues : [ "single_tailnet" ] ,
130
+ expected : "" ,
131
+ } ,
123
132
{
124
133
option : {
125
134
...defaultOption ,
Original file line number Diff line number Diff line change @@ -40,8 +40,10 @@ export function optionValue(
40
40
case "Experiments" : {
41
41
const experimentMap = additionalValues ?. reduce < Record < string , boolean > > (
42
42
( acc , v ) => {
43
- // biome-ignore lint/suspicious/noExplicitAny: opt.value is any
44
- acc [ v ] = ( option . value as any ) . includes ( "*" ) ;
43
+ const isIncluded = Array . isArray ( option . value )
44
+ ? option . value . includes ( "*" )
45
+ : false ;
46
+ acc [ v ] = isIncluded ;
45
47
return acc ;
46
48
} ,
47
49
{ } ,
@@ -57,10 +59,11 @@ export function optionValue(
57
59
58
60
// We show all experiments (including unsafe) that are currently enabled on a deployment
59
61
// but only show safe experiments that are not.
60
- // biome-ignore lint/suspicious/noExplicitAny: opt.value is any
61
- for ( const v of option . value as any ) {
62
- if ( v !== "*" ) {
63
- experimentMap [ v ] = true ;
62
+ if ( Array . isArray ( option . value ) ) {
63
+ for ( const v of option . value ) {
64
+ if ( v !== "*" ) {
65
+ experimentMap [ v ] = true ;
66
+ }
64
67
}
65
68
}
66
69
return experimentMap ;
You can’t perform that action at this time.
0 commit comments