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

pagelet

Package Overview
Dependencies
Maintainers
5
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pagelet - npm Package Compare versions

Comparing version 1.0.0-alpha-5 to 1.0.0-alpha-6

26

index.js

@@ -1087,4 +1087,6 @@ 'use strict';

, method = prototype.method
, status = prototype.status
, router = prototype.path
, name = prototype.name
, view = prototype.view
, log = debug('pagelet:'+ name);

@@ -1117,16 +1119,18 @@

// Prefetch the template if a view is available. The view property is
// mandatory but it's quite silly to enforce this if the pagelet is
// just doing a redirect. We can check for this edge case by
// checking if the set statusCode is in the 300~ range.
// mandatory for all pagelets except the bootstrap Pagelet or if the
// Pagelet is just doing a redirect. We can resolve this edge case by
// checking if statusCode is in the 300~ range.
//
if (prototype.view) {
prototype.view = path.resolve(prototype.directory, prototype.view);
temper.prefetch(prototype.view, prototype.engine);
} else if (!(prototype.statusCode >= 300 && prototype.statusCode < 400)) {
return next(new Error(
'The '+ name +' pagelet for path '+ router +' should have a .view property.'
));
}
if (!view && name !== 'bootstrap' && !(status >= 300 && status < 400)) return next(
new Error('The '+ name +' pagelet should have a .view property.')
);
//
// Resolve the view to ensure the path is correct and prefetch
// the template through Temper.
//
prototype.view = view = path.resolve(prototype.directory, view);
temper.prefetch(view, prototype.engine);
//
// Ensure we have a custom error pagelet when we fail to render this fragment.

@@ -1133,0 +1137,0 @@ //

{
"name": "pagelet",
"version": "1.0.0-alpha-5",
"version": "1.0.0-alpha-6",
"description": "pagelet",

@@ -5,0 +5,0 @@ "main": "index.js",

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