Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty arrays not considered falsy #14

Open
twolfson opened this issue Oct 5, 2014 · 0 comments
Open

Empty arrays not considered falsy #14

twolfson opened this issue Oct 5, 2014 · 0 comments

Comments

@twolfson
Copy link

twolfson commented Oct 5, 2014

There is a divergence from the mustache spec for inverted sections with respect to empty arrays. minstache seems to be handling them as an iterator, not as an inverted section

https://github.com/janl/mustache.js/blob/0.8.2/README.md#inverted-sections

> require('mustache').render('{{^places}}none{{/places}}', {places: []})
'none'
> require('minstache')('{{^places}}none{{/places}}', {places: []})
''
twolfson added a commit to twolfson/minstache that referenced this issue Oct 5, 2014
Added test for populated arrays and inverted

Finished up array logic

Caught logic flaw

Adjusted to more practical test content

Added support for falsy arrays

Added test for falsy arrays
tomas added a commit to tomas/qiq that referenced this issue Nov 17, 2016
Added support for inverted sections and arrays. Fixes visionmedia#14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant