tera
tera copied to clipboard
Support filters in object for loop
While this syntax is currently supported:
for element in array | myfilter
This one is unfortunately not:
for key, value in object | myfilter
I also think this is a problem. But, I have a different view. It would be better to introduce such a syntax element (as is possible in Jinja2):
{% for k, v in my_map if k | length >= 10 and v is not null %}
That is, supporting the ternary operator in for would solve a lot of problems.
I'm not sure about ternaries in for. Tera has continue/break so I feel like it wouldn't be needed, you can just have a if in your loop