2016-01-27 10:29:26 +00:00
|
|
|
(function() {
|
2018-02-12 05:05:29 +00:00
|
|
|
/**
|
|
|
|
Template helper definitions for Underscore.
|
|
|
|
@license MIT. See LICENSE.md for details.
|
|
|
|
@module handlebars-helpers.js
|
|
|
|
*/
|
2016-01-27 10:29:26 +00:00
|
|
|
var HANDLEBARS, _, helpers;
|
|
|
|
|
|
|
|
HANDLEBARS = require('handlebars');
|
|
|
|
|
|
|
|
_ = require('underscore');
|
|
|
|
|
|
|
|
helpers = require('./generic-helpers');
|
|
|
|
|
|
|
|
/**
|
|
|
|
Register useful Underscore helpers.
|
|
|
|
@method registerHelpers
|
2018-02-12 05:05:29 +00:00
|
|
|
*/
|
2016-01-27 10:29:26 +00:00
|
|
|
module.exports = function(theme, opts, cssInfo, ctx, eng) {
|
|
|
|
helpers.theme = theme;
|
|
|
|
helpers.opts = opts;
|
|
|
|
helpers.cssInfo = cssInfo;
|
|
|
|
helpers.engine = eng;
|
|
|
|
ctx.h = helpers;
|
2016-02-09 20:27:34 +00:00
|
|
|
_.each(helpers, function(hVal, hKey) {
|
2016-01-27 10:29:26 +00:00
|
|
|
if (_.isFunction(hVal)) {
|
|
|
|
return _.bind(hVal, ctx);
|
|
|
|
}
|
|
|
|
}, this);
|
|
|
|
};
|
|
|
|
|
|
|
|
}).call(this);
|
2016-02-02 02:14:36 +00:00
|
|
|
|
|
|
|
//# sourceMappingURL=underscore-helpers.js.map
|