falsey values don't match reference implementation?
https://mustache.github.io/#demo if you set "empty": 0 it is still treated as falsey. Afair, this was also the case for hastache. But stache does not.
Note that the spec seems to talk about falsey not false.
https://github.com/mustache/spec/blob/master/specs/sections.yml#L44
Where do you see an example in the spec which demands that zero is to be treated as a falsey value? We run all the examples, so if there were such an example, then the test suite would catch it.
What is not imposed by the spec is left at implementer's discretion. That said, maybe 0 should be treated as a falsey value.
We need to check what mustache does in this case.
Just to get an idea of what other implementations in the same language do. I'll mark this as a feature request awaiting PR, it is unlikely that I'll have time or motivation to do the change myself, but you are welcome to try.
The reference implementation appears to be the ruby one:
- https://github.com/mustache/mustache
- https://mustache.github.io/mustache.1.html
Which definitely treats 0 as falsey.
So the question is, whether we want to keep underspecified behavior in sync with the reference implementation.
I'd merge this change.