mirror of
https://github.com/hoshikawa2/first_contas.git
synced 2026-07-10 02:34:20 +00:00
first commit
This commit is contained in:
14
legacy_reference/workflows/templating.py
Normal file
14
legacy_reference/workflows/templating.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Any
|
||||
|
||||
from agente_contas_tim.workflows.conditions import resolve_value
|
||||
|
||||
|
||||
def render_template(template: Any, context: dict[str, Any]) -> Any:
|
||||
"""Resolve templates recursivos com paths $.x.y."""
|
||||
if isinstance(template, dict):
|
||||
return {key: render_template(value, context) for key, value in template.items()}
|
||||
if isinstance(template, list):
|
||||
return [render_template(item, context) for item in template]
|
||||
return resolve_value(template, context)
|
||||
Reference in New Issue
Block a user