Skip to content
Browse files

it turns out express@1.0.0 in npm is actually master branch version.

added extra check to copy body into locals only if it exists in options which should work with 'real' v1.0.0.
  • Loading branch information...
1 parent f22754a commit ff10a0ba1773a52522b4136b51144d3d47a92bb3 @donpark committed
Showing with 4 additions and 2 deletions.
  1. +3 −1 lib/hbs.js
  2. +1 −1 package.json
View
4 lib/hbs.js
@@ -5,7 +5,9 @@ var compile = exports.compile = function (source, options) {
var template = handlebars.compile(source);
return function (options) {
var locals = options.locals || (options.locals = {});
- locals.body = options.body;
+ if (options.body) { // for express.js > v1.0
+ locals.body = options.body;
+ }
return template(locals, options.blockHelpers);
};
} else {
View
2 package.json
@@ -1,7 +1,7 @@
{
"name": "hbs",
"description": "Express.js template engine plugin for Handlebars",
- "version": "0.0.3-3",
+ "version": "0.0.3-4",
"homepage": "https://github.com/donpark/hbs",
"author": "Don Park <donpark@docuverse.com> (http://blog.docuverse.com)",
"directories": {

0 comments on commit ff10a0b

Please sign in to comment.
Something went wrong with that request. Please try again.