New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

co-nested-hbs

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

co-nested-hbs - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

test/test/test.hbs

16

index.js

@@ -99,8 +99,16 @@ var fs = require('fs');

if (renderOpts.viewPathPrefix) {
templates = templates.map(function(tmpl) {
return path.join(renderOpts.viewPathPrefix, tmpl);
});
}
if (renderOpts.layout !== false) {
templates = templates.concat(hbs.layouts);
if (renderOpts.layout) {
templates = templates.concat([renderOpts.layout]);
} else {
templates = templates.concat(hbs.layouts);
}
}
renderViewPath = renderOpts.viewPath || viewPath;
for(i = 0, len = templates.length; i < len; i++) {

@@ -111,3 +119,3 @@ tmpl = templates[i];

buffer = yield renderTemplate(renderViewPath, opts.partialsPath, tmpl, locals);
buffer = yield renderTemplate(viewPath, opts.partialsPath, tmpl, locals);
}

@@ -114,0 +122,0 @@

{
"name": "co-nested-hbs",
"version": "0.2.0",
"version": "0.2.1",
"repository": "speedmanly/co-nested-hbs",

@@ -5,0 +5,0 @@ "description": "Generator-based Handlebars templates for nested layouts.",

@@ -87,10 +87,19 @@ var assert = require('assert');

it('takes a last argument to replace the default viewPath', function(done) {
it('takes a last argument to choose a new layout', function(done) {
co(function *() {
var view = require('..')('madeuppath'),
html = yield view.render('c', {}, {viewPath: 'test'});
var view = require('..')('test', {layout: 'a'}),
html = yield view.render('c', {}, {layout: 'b'});
assert.equal(html, 'c\n');
assert.equal(html, '<b>c\n</b>\n');
})(done);
});
it('takes a last argument to prefix the given templates', function(done) {
co(function *() {
var view = require('..')('test'),
html = yield view.render('test', {}, {viewPathPrefix: 'test'});
assert.equal(html, 'test\n');
})(done);
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc