@@ -63,7 +63,7 @@ public async Task<bool> DeleteConfigurationAsync(string key, bool isGlobal = fal
6363
6464 // Delete using dot notation support and return whether deletion occurred
6565 var deleted = DeleteNestedValue ( settings , key ) ;
66-
66+
6767 if ( deleted )
6868 {
6969 // Write the updated settings
@@ -79,7 +79,7 @@ public async Task<bool> DeleteConfigurationAsync(string key, bool isGlobal = fal
7979 }
8080 }
8181
82- private string GetSettingsFilePath ( bool isGlobal )
82+ public string GetSettingsFilePath ( bool isGlobal )
8383 {
8484 if ( isGlobal )
8585 {
@@ -129,7 +129,7 @@ private static async Task LoadConfigurationFromFileAsync(string filePath, Dictio
129129 {
130130 var content = await File . ReadAllTextAsync ( filePath , cancellationToken ) ;
131131 var settings = JsonNode . Parse ( content ) ? . AsObject ( ) ;
132-
132+
133133 if ( settings is not null )
134134 {
135135 FlattenJsonObject ( settings , config , string . Empty ) ;
@@ -154,13 +154,13 @@ private static void SetNestedValue(JsonObject settings, string key, string value
154154 for ( int i = 0 ; i < keyParts . Length - 1 ; i ++ )
155155 {
156156 var part = keyParts [ i ] ;
157-
157+
158158 // If the property doesn't exist or isn't an object, replace it with a new object
159159 if ( ! currentObject . ContainsKey ( part ) || currentObject [ part ] is not JsonObject )
160160 {
161161 currentObject [ part ] = new JsonObject ( ) ;
162162 }
163-
163+
164164 currentObject = currentObject [ part ] ! . AsObject ( ) ;
165165 }
166166
@@ -184,17 +184,17 @@ private static bool DeleteNestedValue(JsonObject settings, string key)
184184 {
185185 var part = keyParts [ i ] ;
186186 objectPath . Add ( ( currentObject , part ) ) ;
187-
187+
188188 if ( ! currentObject . ContainsKey ( part ) || currentObject [ part ] is not JsonObject )
189189 {
190190 return false ; // Path doesn't exist
191191 }
192-
192+
193193 currentObject = currentObject [ part ] ! . AsObject ( ) ;
194194 }
195195
196196 var finalKey = keyParts [ keyParts . Length - 1 ] ;
197-
197+
198198 // Check if the final key exists
199199 if ( ! currentObject . ContainsKey ( finalKey ) )
200200 {
@@ -208,7 +208,7 @@ private static bool DeleteNestedValue(JsonObject settings, string key)
208208 for ( int i = objectPath . Count - 1 ; i >= 0 ; i -- )
209209 {
210210 var ( parentObject , parentKey ) = objectPath [ i ] ;
211-
211+
212212 // If the current object is empty, remove it from its parent
213213 if ( currentObject . Count == 0 )
214214 {
@@ -232,7 +232,7 @@ private static void FlattenJsonObject(JsonObject obj, Dictionary<string, string>
232232 foreach ( var kvp in obj )
233233 {
234234 var key = string . IsNullOrEmpty ( prefix ) ? kvp . Key : $ "{ prefix } .{ kvp . Key } ";
235-
235+
236236 if ( kvp . Value is JsonObject nestedObj )
237237 {
238238 FlattenJsonObject ( nestedObj , result , key ) ;
0 commit comments