broadway-handlebars
Advanced tools
Comparing version 0.1.13 to 0.1.14
15
index.js
@@ -54,8 +54,17 @@ var _ = require('lodash'), | ||
// http://documentcloud.github.com/underscore/#range | ||
Handlebars.registerHelper('range', function(stop, options) { | ||
Handlebars.registerHelper('range', function(expression, options) { | ||
var buffer = [], | ||
range = _.range((options.hash.start || 0), stop, (options.hash.step || 1)), | ||
stop = 0, | ||
that = this; | ||
_.each(range, function(v, k) { | ||
if (typeof(expression) == 'string') { | ||
with(this) { | ||
stop = eval(expression); | ||
} | ||
} | ||
else { | ||
stop = expression; | ||
} | ||
_.each(_.range((options.hash.start || 0), stop, (options.hash.step || 1)), function(v, k) { | ||
try { | ||
@@ -62,0 +71,0 @@ buffer.push(options.fn( _.extend(_.clone(that), { key: k, value: v }))); |
{ | ||
"name": "broadway-handlebars", | ||
"version": "0.1.13", | ||
"version": "0.1.14", | ||
"main": "index", | ||
@@ -5,0 +5,0 @@ "description": "Plugin for flatiron/broadway for rendering with the handlebars view engine.", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
9853
271