Created
September 11, 2013 18:34
-
-
Save eyy/6527837 to your computer and use it in GitHub Desktop.
dust.js helper: first item
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dust.helpers.first = function(chunk, context, bodies) { | |
if (context.stack.index == 0) | |
return chunk.render(bodies.block, context); | |
else if (bodies['else']) | |
return chunk.render(bodies['else'], context); | |
else | |
return chunk; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment