Files
bower/lib/templates/helpers/indent.js
Adam Stankiewicz 0a8a4f9029 Format with prettier
2018-03-28 19:10:16 +02:00

13 lines
330 B
JavaScript

var mout = require('mout');
function indent(Handlebars) {
Handlebars.registerHelper('indent', function(context) {
var hash = context.hash;
var indentStr = mout.string.repeat(' ', parseInt(hash.level, 10));
return context.fn(this).replace(/\n/g, '\n' + indentStr);
});
}
module.exports = indent;