Socket
Socket
Sign inDemoInstall

middl

Package Overview
Dependencies
5
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.3.1 to 0.4.0

2

package.json
{
"name": "middl",
"version": "0.3.1",
"version": "0.4.0",
"description": "A generic middleware library, inspired by Express and suitable for anything",

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

@@ -36,3 +36,3 @@ 'use strict';

function app(input, output) {
return run(input, output);
return app.run(input, output);
}

@@ -39,0 +39,0 @@ // attach public app api:

@@ -494,1 +494,15 @@ import test from 'ava';

});
test('app.run() should be patchable', async t => {
const app = middl();
const _run = app.run;
app.run = (input, output) => {
input.patched = true;
return _run(input, output);
};
app.use((input, output) => {
output.val = input.patched ? 'patched' : 'not patched';
});
const result = await app({}, {});
t.is(result.val, 'patched');
});
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc