Support {% if item in list %}
kdawgwilk opened this issue · 4 comments
kdawgwilk commented
I have been wishing I could do something list the following in Stencil templates
{% if item in list%}
// Do stuff here now that we know this is in the list
{% endif %}
kdawgwilk commented
I initially brought this up over in Sourcery krzysztofzablocki/Sourcery#415
AliSoftware commented
Couldn't you just do {% if list|contains:item %}
? Or does that contains filter not work with arrays but only strings?
kdawgwilk commented
I have not tried this but I will give it a go
ilyapuchka commented
@AliSoftware @kdawgwilk according to StencilSwiftKit code it looks like it is indeed defined only on strings