mangony-hbs-helpers
Version:
Handlebars helpers used by Mangony
17 lines (14 loc) • 323 B
JavaScript
/*
* Returns a bool if this is the first element in a loop
* Returns boolean
*
* @author Sebastian Fitzner
*/
module.exports = isFirst;
module.exports.register = function (Handlebars) {
Handlebars.registerHelper('isFirst', isFirst);
};
function isFirst(idx) {
var first = parseInt(idx, 10);
return first === 0;
}