@@ -79,12 +79,15 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
7979 /**
8080 * Aka watched settings.
8181 */
82+ #refreshEnabled: boolean = false ;
8283 #sentinels: ConfigurationSettingId [ ] = [ ] ;
8384 #watchAll: boolean = false ;
8485 #kvRefreshInterval: number = DEFAULT_REFRESH_INTERVAL_IN_MS ;
8586 #kvRefreshTimer: RefreshTimer ;
8687
8788 // Feature flags
89+ #featureFlagEnabled: boolean = false ;
90+ #featureFlagRefreshEnabled: boolean = false ;
8891 #ffRefreshInterval: number = DEFAULT_REFRESH_INTERVAL_IN_MS ;
8992 #ffRefreshTimer: RefreshTimer ;
9093
@@ -117,14 +120,15 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
117120 this . #featureFlagTracing = new FeatureFlagTracingOptions ( ) ;
118121 }
119122
120- if ( options ?. trimKeyPrefixes ) {
123+ if ( options ?. trimKeyPrefixes !== undefined ) {
121124 this . #sortedTrimKeyPrefixes = [ ...options . trimKeyPrefixes ] . sort ( ( a , b ) => b . localeCompare ( a ) ) ;
122125 }
123126
124127 // if no selector is specified, always load key values using the default selector: key="*" and label="\0"
125128 this . #kvSelectors = getValidKeyValueSelectors ( options ?. selectors ) ;
126129
127- if ( options ?. refreshOptions ?. enabled ) {
130+ if ( options ?. refreshOptions ?. enabled === true ) {
131+ this . #refreshEnabled = true ;
128132 const { refreshIntervalInMs, watchedSettings } = options . refreshOptions ;
129133 if ( watchedSettings === undefined || watchedSettings . length === 0 ) {
130134 this . #watchAll = true ; // if no watched settings is specified, then watch all
@@ -151,11 +155,13 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
151155 }
152156
153157 // feature flag options
154- if ( options ?. featureFlagOptions ?. enabled ) {
158+ if ( options ?. featureFlagOptions ?. enabled === true ) {
159+ this . #featureFlagEnabled = true ;
155160 // validate feature flag selectors, only load feature flags when enabled
156161 this . #ffSelectors = getValidFeatureFlagSelectors ( options . featureFlagOptions . selectors ) ;
157162
158- if ( options . featureFlagOptions . refresh ?. enabled ) {
163+ if ( options . featureFlagOptions . refresh ?. enabled === true ) {
164+ this . #featureFlagRefreshEnabled = true ;
159165 const { refreshIntervalInMs } = options . featureFlagOptions . refresh ;
160166 // custom refresh interval
161167 if ( refreshIntervalInMs !== undefined ) {
@@ -169,7 +175,7 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
169175 }
170176 }
171177
172- if ( options ?. keyVaultOptions ) {
178+ if ( options ?. keyVaultOptions !== undefined ) {
173179 const { secretRefreshIntervalInMs } = options . keyVaultOptions ;
174180 if ( secretRefreshIntervalInMs !== undefined ) {
175181 if ( secretRefreshIntervalInMs < MIN_SECRET_REFRESH_INTERVAL_IN_MS ) {
@@ -183,18 +189,6 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
183189 this . #adapters. push ( new JsonKeyValueAdapter ( ) ) ;
184190 }
185191
186- get #refreshEnabled( ) : boolean {
187- return ! ! this . #options?. refreshOptions ?. enabled ;
188- }
189-
190- get #featureFlagEnabled( ) : boolean {
191- return ! ! this . #options?. featureFlagOptions ?. enabled ;
192- }
193-
194- get #featureFlagRefreshEnabled( ) : boolean {
195- return this . #featureFlagEnabled && ! ! this . #options?. featureFlagOptions ?. refresh ?. enabled ;
196- }
197-
198192 get #requestTraceOptions( ) : RequestTracingOptions {
199193 return {
200194 enabled : this . #requestTracingEnabled,
0 commit comments