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.1 to 0.6.2

8

lib/controller.js

@@ -165,4 +165,12 @@ var isRegExp = require('util').isRegExp;

var self = this;
//clear old anonymous middlewares if we're overwriting
if (this.actions[name]) {
self.middlewares.forEach(function(middleware) {
if (middleware.anonymous && middleware.scope[0] == name)
self.middlewares = _.without(self.middlewares, middleware);
});
}
groups = groups.filter(function(group) {
if (typeof group == "function") {
group.anonymous = true;
self.use(name, group);

@@ -169,0 +177,0 @@ return false;

2

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

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

@@ -197,2 +197,14 @@ var assert = require('assert');

});
it('should override ungrouped middleware', function(done) {
var c = ctrl();
c.define('action', [makemw('thingmw')], routestr('thing'));
c.define('action', [makemw('thingmw2')], routestr('thing'));
c.route('get', '/action', 'action');
req(express().use(c))
.get('/action')
.expect(200)
.expect('thingmw2')
.end(done);
});
it('should apply grouped middleware with use()', function(done) {

@@ -199,0 +211,0 @@ var c = ctrl();

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