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

middie

Package Overview
Dependencies
Maintainers
2
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

middie - npm Package Compare versions

Comparing version 3.0.0 to 3.1.0

9

middie.js

@@ -70,2 +70,11 @@ 'use strict'

if (res.finished === true) {
that.req = null
that.res = null
that.context = null
that.i = 0
pool.release(that)
return
}
if (err || middlewares.length === i) {

@@ -72,0 +81,0 @@ complete(err, req, res, context)

2

package.json
{
"name": "middie",
"version": "3.0.0",
"version": "3.1.0",
"description": "Middleware engine for Fastify",

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

@@ -333,1 +333,30 @@ 'use strict'

})
test('if the function calls res.end the iterator should stop', t => {
t.plan(1)
const instance = middie(function () {
t.fail('we should not be here')
})
const req = {
url: '/test'
}
const res = {
finished: false,
end: function () {
t.pass('res.end')
this.finished = true
}
}
instance
.use(function (req, res, next) {
res.end('hello')
next()
})
.use(function (req, res, next) {
t.fail('we should not be here')
})
instance.run(req, res)
})
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