Comparing version 0.2.3 to 0.2.4
11
index.js
@@ -42,2 +42,7 @@ /*! | ||
this.context = _.extend({}, this.options.locals); | ||
delete this.options.cache; | ||
delete this.cache.data; | ||
this.flattenData(this.cache, 'cache'); | ||
} | ||
@@ -181,4 +186,5 @@ | ||
Layouts.prototype.extendData = function (opts, tmpl) { | ||
_.extend(this.context, opts, opts.locals, tmpl, tmpl.data); | ||
this.context = _.omit(this.context, ['content', 'delims', 'layout', 'data', 'locals']); | ||
this.extend(this.context, opts, opts.locals, tmpl, tmpl.data); | ||
var omit = ['extend', 'content', 'delims', 'layout', 'data', 'locals']; | ||
this.context = _.omit(this.context, omit); | ||
return this; | ||
@@ -239,2 +245,3 @@ }; | ||
this.extendData(opts, tmpl); | ||
this.flattenData(this.context); | ||
@@ -241,0 +248,0 @@ return { |
{ | ||
"name": "layouts", | ||
"description": "Wrap templates with layouts. Layouts can be nested and optionally use other layouts.", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"homepage": "https://github.com/jonschlinkert/layouts", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -42,5 +42,4 @@ /*! | ||
layouts.setLayout('last', undefined, 'last!\n{{body}}\nlast!'); | ||
Object.keys(layouts.cache).length.should.eql(8); | ||
}); | ||
}); |
36602
852