Comparing version 0.2.4 to 0.2.5
12
index.js
@@ -39,3 +39,3 @@ /*! | ||
this.defaultTag = this.makeTag(this.options); | ||
this.extend = this.options.extend || _.extend; | ||
this.mergeData = this.options.extend || _.extend; | ||
_.extend(this.cache, this.options.cache, this.options.layouts); | ||
@@ -175,3 +175,3 @@ this.context = _.extend({}, this.options.locals); | ||
/** | ||
* ## .extendData | ||
* ## .mergeData | ||
* | ||
@@ -186,6 +186,7 @@ * Extend `data` with the given `obj. A custom function can be | ||
Layouts.prototype.extendData = function (opts, tmpl) { | ||
this.extend(this.context, opts, opts.locals, tmpl, tmpl.data); | ||
Layouts.prototype._mergeData = function (opts, tmpl) { | ||
this.mergeData(this.context, opts, opts.locals, tmpl, tmpl.data); | ||
var omit = ['extend', 'content', 'delims', 'layout', 'data', 'locals']; | ||
this.context = _.omit(this.context, omit); | ||
this.flattenData(this.context); | ||
return this; | ||
@@ -245,4 +246,3 @@ }; | ||
var tmpl = this.cache[layout]; | ||
this.extendData(opts, tmpl); | ||
this.flattenData(this.context); | ||
this._mergeData(opts, tmpl); | ||
@@ -249,0 +249,0 @@ return { |
{ | ||
"name": "layouts", | ||
"description": "Wrap templates with layouts. Layouts can be nested and optionally use other layouts.", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"homepage": "https://github.com/jonschlinkert/layouts", | ||
@@ -6,0 +6,0 @@ "author": { |
36605