You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
402 B
21 lines
402 B
var Handlebars = require('handlebars');
|
|
|
|
Handlebars.registerHelper('times', function(n, block) {
|
|
var accum = '';
|
|
|
|
for (var i = 0; i < n; ++i) {
|
|
accum += block.fn(i);
|
|
}
|
|
|
|
return accum;
|
|
});
|
|
|
|
Handlebars.registerHelper('for', function(from, to, incr, block) {
|
|
var accum = '';
|
|
|
|
for (var i = from; i < to; i += incr) {
|
|
accum += block.fn(i);
|
|
}
|
|
|
|
return accum;
|
|
}); |