mirror of
https://github.com/bower/bower.git
synced 2026-04-24 03:00:19 -04:00
Adds test for template util methods Upgrades handlebars Fixes RangeError due to `length` attribute in rpad helper
13 lines
333 B
JavaScript
13 lines
333 B
JavaScript
var mout = require('mout');
|
|
|
|
function rpad(Handlebars) {
|
|
Handlebars.registerHelper('rpad', function (context) {
|
|
var hash = context.hash;
|
|
var minLength = parseInt(hash.minLength, 10);
|
|
var chr = hash.char;
|
|
return mout.string.rpad(context.fn(this), minLength, chr);
|
|
});
|
|
}
|
|
|
|
module.exports = rpad;
|