@budibase/handlebars-helpers
Advanced tools
Comparing version 0.13.1 to 0.13.2
@@ -6,2 +6,3 @@ 'use strict'; | ||
var helpers = module.exports; | ||
let lorem = require('./lorem.js'); | ||
@@ -806,1 +807,25 @@ /** | ||
}; | ||
/** | ||
* Takes a number and returns that many charaters of Lorem Ipsum | ||
* | ||
* ```handlebars | ||
* {{lorem 11}} | ||
* <!-- results in: 'Lorem Ipsum' --> | ||
* ``` | ||
* @param {Number} `num` The string to uppercase | ||
* @return {String} | ||
* @block | ||
* @inline | ||
* @api public | ||
* @example {{lorem 11}} -> Lorem ipsum | ||
*/ | ||
helpers.lorem = function(num) { | ||
// Sad Path - Not a number, or not greater than 1, or not truthy | ||
if (isNaN(num) || num < 1 || !num) { | ||
num = 11; | ||
} | ||
return lorem.substring(0, num); | ||
}; |
{ | ||
"name": "@budibase/handlebars-helpers", | ||
"description": "More than 130 Handlebars helpers in ~20 categories. Helpers can be used with Assemble, Generate, Verb, Ghost, gulp-handlebars, grunt-handlebars, consolidate, or any node.js/Handlebars project.", | ||
"version": "0.13.1", | ||
"version": "0.13.2", | ||
"homepage": "https://github.com/Budibase/handlebars-helpers", | ||
@@ -72,3 +72,3 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", | ||
"scripts": { | ||
"lint": "eslint *.js lib/**/*.js test/**/*.js", | ||
"lint": "eslint *.js lib/*.js lib/**/*.js lib/*.js test/*.js test/*/*.js", | ||
"test": "mocha", | ||
@@ -75,0 +75,0 @@ "update:readmemd": "verb" |
205508
30
4129