Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allow options to be optional

  • Loading branch information...
commit 47d975378fec8da05ba93f17f52e39c5262caf40 1 parent 8615a0d
@jafl jafl authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/hbs.js
View
6 lib/hbs.js
@@ -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;
Please sign in to comment.
Something went wrong with that request. Please try again.