UNPKG
hbs-helper
Version:
latest (0.0.5)
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1
handlebar template engine's helper
github.com/Canner/hbs-helper
Canner/hbs-helper
hbs-helper
/
defaults
/
ifOdd.js
9 lines
•
230 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
module
.
exports
=
function
(
hbs
){ hbs.
registerHelper
(
'ifOdd'
,
function
(
conditional, options
) {
if
((conditional %
2
) ==
1
) {
return
options.
fn
(
this
); }
else
{
return
options.
inverse
(
this
); } }); }