mirror of
https://github.com/kevinveenbirkenbach/homepage.veen.world.git
synced 2025-06-29 08:12:01 +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.
|
KeyError: If the path cannot be resolved.
|
||||||
ValueError: If the resolved entry is not of the expected type.
|
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
|
parts = path.split('.') # Split the path into segments
|
||||||
current = config
|
current = config
|
||||||
|
|
||||||
@ -115,8 +116,7 @@ class ConfigurationResolver:
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Stop navigating into `subitems` unless explicitly required by the path
|
# Stop navigating into `subitems` unless explicitly required by the path
|
||||||
if isinstance(current, dict) and "subitems" in current and isinstance(current["subitems"], list):
|
if isinstance(current, dict) and "subitems" in current and isinstance(current["subitems"], list) and part != "subitems":
|
||||||
if part != "subitems":
|
|
||||||
break # Stop navigation if `subitems` is not explicitly in the path
|
break # Stop navigation if `subitems` is not explicitly in the path
|
||||||
|
|
||||||
# Ensure the resolved target is a dictionary or string
|
# Ensure the resolved target is a dictionary or string
|
||||||
|
Loading…
x
Reference in New Issue
Block a user