Permalink
Browse files

Allow options to be optional

  • Loading branch information...
jafl committed Nov 12, 2012
1 parent 8615a0d commit 47d975378fec8da05ba93f17f52e39c5262caf40
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/hbs.js
View
@@ -129,15 +129,15 @@ function cachePartials() {
*
*/
exports.express3 = function(options) {
- _options = options;
+ _options = options || {};
if (!_options.extname) _options.extname = '.hbs';
- if (options && options.handlebars) exports.handlebars = options.handlebars;
+ if (_options && _options.handlebars) exports.handlebars = _options.handlebars;
exports.handlebars.registerHelper('contentFor', contentFor);
exports.handlebars.registerHelper('block', block);
- partialsDir = options && options.partialsDir;
+ partialsDir = _options && _options.partialsDir;
if (partialsDir) cachePartials();
return _express3;

0 comments on commit 47d9753

Please sign in to comment.