Recursively process dictionary to replace environment variables. Args: config (Dict[str, Any]): The configuration dictionary to process. Returns: Dict[str, Any]: The processed configuration dictionary with environment variables replaced.
(config: Dict[str, Any])
| 75 | |
| 76 | |
| 77 | def process_dict(config: Dict[str, Any]) -> Dict[str, Any]: |
| 78 | """ |
| 79 | Recursively process dictionary to replace environment variables. |
| 80 | |
| 81 | Args: |
| 82 | config (Dict[str, Any]): The configuration dictionary to process. |
| 83 | |
| 84 | Returns: |
| 85 | Dict[str, Any]: The processed configuration dictionary with environment variables replaced. |
| 86 | """ |
| 87 | if not config: |
| 88 | return {} |
| 89 | |
| 90 | result = {} |
| 91 | for key, value in config.items(): |
| 92 | if isinstance(value, dict): |
| 93 | result[key] = process_dict(value) |
| 94 | elif isinstance(value, str): |
| 95 | result[key] = replace_env_vars(value) |
| 96 | else: |
| 97 | result[key] = value |
| 98 | return result |
| 99 | |
| 100 | |
| 101 | def replace_env_vars(value: str) -> str: |
no test coverage detected