mirror of
https://github.com/kevinveenbirkenbach/homepage.veen.world.git
synced 2025-06-28 23:55:31 +02:00
Refactored code
This commit is contained in:
parent
e2aee76f54
commit
cdfefe5a63
@ -74,6 +74,7 @@ class ConfigurationResolver:
|
||||
KeyError: If the path cannot be resolved.
|
||||
ValueError: If the resolved entry is not of the expected type.
|
||||
"""
|
||||
print(f"Current path being resolved: {path}")
|
||||
parts = path.split('.') # Split the path into segments
|
||||
current = config
|
||||
|
||||
@ -115,9 +116,8 @@ class ConfigurationResolver:
|
||||
)
|
||||
|
||||
# Stop navigating into `subitems` unless explicitly required by the path
|
||||
if isinstance(current, dict) and "subitems" in current and isinstance(current["subitems"], list):
|
||||
if part != "subitems":
|
||||
break # Stop navigation if `subitems` is not explicitly in the path
|
||||
if isinstance(current, dict) and "subitems" in current and isinstance(current["subitems"], list) and part != "subitems":
|
||||
break # Stop navigation if `subitems` is not explicitly in the path
|
||||
|
||||
# Ensure the resolved target is a dictionary or string
|
||||
if not isinstance(current, (dict, str)):
|
||||
|
Loading…
x
Reference in New Issue
Block a user