1
0
mirror of https://github.com/JuanCanham/HackMyResume.git synced 2024-11-22 16:30:11 +00:00
HackMyResume/dist/helpers/handlebars-helpers.js

49 lines
1.1 KiB
JavaScript
Raw Normal View History

2016-01-27 10:29:26 +00:00
/**
Template helper definitions for Handlebars.
@license MIT. See LICENSE.md for details.
2016-01-27 10:29:26 +00:00
@module handlebars-helpers.js
*/
(function() {
var HANDLEBARS, _, blockHelpers, helpers;
2016-01-27 10:29:26 +00:00
HANDLEBARS = require('handlebars');
_ = require('underscore');
helpers = require('./generic-helpers');
blockHelpers = require('./block-helpers');
2016-01-27 10:29:26 +00:00
/**
Register useful Handlebars helpers.
@method registerHelpers
*/
module.exports = function(theme, opts) {
var wrappedHelpers;
2016-01-27 10:29:26 +00:00
helpers.theme = theme;
helpers.opts = opts;
helpers.type = 'handlebars';
wrappedHelpers = _.mapObject(helpers, function(hVal, hKey) {
if (_.isFunction(hVal)) {
_.wrap(hVal, function(func) {
var args;
args = Array.prototype.slice.call(arguments);
args.shift();
args.pop();
return func.apply(this, args);
});
}
return hVal;
}, this);
HANDLEBARS.registerHelper(wrappedHelpers);
HANDLEBARS.registerHelper(blockHelpers);
2016-01-27 10:29:26 +00:00
};
}).call(this);
2016-02-02 02:14:36 +00:00
//# sourceMappingURL=handlebars-helpers.js.map