Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

controller

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

controller - npm Package Compare versions

Comparing version 0.6.0 to 0.6.1

15

lib/controller.js

@@ -66,2 +66,11 @@ var isRegExp = require('util').isRegExp;

// Have run into production problems where controllers are created from different
// instances of the Controller library due to weird dependency installations -
// which means that we can't reference the `Controller` var and do `instanceof`,
// we have to set some kind of constant and check against it. At least, that
// seems like the most sensible way to me.
Object.defineProperty(Controller.prototype, '_type', {
enumerable: false, configurable: false, writable: false, value: '_controller_express_ext'
});
function collectMiddlewares(scope) {

@@ -77,3 +86,3 @@ var inScope = function(group) { return ~scope.indexOf(group); };

if (!base) base = [];
if (this.parent instanceof Controller)
if (this.parent && this.parent._type && this.parent._type == this._type)
base = _collectMiddlewares.call(this.parent, scope, base);

@@ -201,4 +210,4 @@

var createAnonymousGroupName = (function() {
var anonCount = 0;
return function() { return 'anonymous-middleware-group-' + ++anonCount }
var anonSeed = Math.floor(Math.random() * Math.pow(10, 10));
return function() { return 'anonymous-middleware-group-' + ++anonSeed }
})();

2

package.json
{
"name": "controller",
"version": "0.6.0",
"version": "0.6.1",
"description": "an action controller for express",

@@ -5,0 +5,0 @@ "main": "lib/controller.js",

@@ -283,3 +283,3 @@ var assert = require('assert');

c1.define('action', ['thing'], routestr('string'));
c1.define('action', ['thing', makemw('mw5')], routestr('string'));
c1.use(makemw('mw1'));

@@ -294,3 +294,3 @@ c0.use('thing', makemw('mw2'));

.expect(200)
.expect('mw4mw1mw2mw3')
.expect('mw4mw1mw2mw3mw5')
.end(done);

@@ -297,0 +297,0 @@ });

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