I have a JSON being passed to a Dust template and want to compare multiple keys for the same value. For example I have a JSON like:
"data": {
"abc": "true",
"xyz": "true",
"uno": "true"
}
Is there a way apart from using "IF" condition(it's deprecated), to compare all of them at once?
I don't wanna do
{?data.abc}
{?data.xyz}
{?data.uno}
<DO something when all of them are true>
{/data.uno}
{/data.xyz}
{/data.abc}
Is there a better way to do the above conditions?
P.S. for dust-helper version 1.5.0 or lower.
After talking to a few developers and researching a lot, there are no specific dustjs filters designed for such a use case for dust-helper version 1.5.0 or lower.
Having said that, the following code seems to work pretty well,
P.S. I couldn't compare boolean values, but if I pass boolean value
trueas a string "true", it works perfectly.