Skip to content

Commit

Permalink
options overwriting for doT.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Fen1kz committed Apr 6, 2015
1 parent 326e35d commit 7619b9a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/consolidate.js
Original file line number Diff line number Diff line change
Expand Up @@ -865,8 +865,12 @@ exports.dot = fromStringRenderer('dot');

exports.dot.render = function (str, options, fn) {
var engine = requires.dot || (requires.dot = require('dot'));
var extend = (requires.extend || (requires.extend = require('util')._extend));
try {
var tmpl = cache(options) || cache(options, engine.compile(str, options && options._def));
var settings = {};
settings = extend(settings, engine.templateSettings);
settings = extend(settings, options ? options.dot : {});
var tmpl = cache(options) || cache(options, engine.template(str, settings, options && options._def));
fn(null, tmpl(options));
} catch (err) {
fn(err);
Expand Down

0 comments on commit 7619b9a

Please sign in to comment.