Socket
Socket
Sign inDemoInstall

avvio

Package Overview
Dependencies
Maintainers
2
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

avvio - npm Package Compare versions

Comparing version 7.1.1 to 7.1.2

11

boot.js

@@ -332,7 +332,16 @@ 'use strict'

/**
* The `encapsulateThreeParam` let callback function
* bind to the right server instance.
* In promises we need to track the last server
* instance loaded, the first one in the _current queue.
*/
const relativeContext = this._current[0].server
function readyPromiseCB (err, context, done) {
// the context is always binded to the root server
if (err) {
reject(err)
} else {
resolve(context)
resolve(relativeContext)
}

@@ -339,0 +348,0 @@ process.nextTick(done)

2

package.json
{
"name": "avvio",
"version": "7.1.1",
"version": "7.1.2",
"description": "Asynchronous bootstrapping of Node applications",

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

@@ -199,2 +199,53 @@ 'use strict'

test('if the after/ready async, the returns must be the context generated', (t) => {
t.plan(3)
const server = { my: 'server', index: 0 }
const app = boot(server)
app.override = function (old) {
return { ...old, index: old.index + 1 }
}
app.use(function (s, opts, done) {
s.use(function (s, opts, done) {
s.ready().then(itself => t.deepEqual(itself, s, 'deep deep'))
done()
})
s.ready().then(itself => t.deepEqual(itself, s, 'deep'))
done()
})
app.ready().then(itself => t.deepEqual(itself, server, 'outer'))
})
test('if the after/ready callback, the returns must be the context generated', (t) => {
t.plan(3)
const server = { my: 'server', index: 0 }
const app = boot(server)
app.override = function (old) {
return { ...old, index: old.index + 1 }
}
app.use(function (s, opts, done) {
s.use(function (s, opts, done) {
s.ready((_, itself, done) => {
t.deepEqual(itself, s, 'deep deep')
done()
})
done()
})
s.ready((_, itself, done) => {
t.deepEqual(itself, s, 'deep')
done()
})
done()
})
app.ready((_, itself, done) => {
t.deepEqual(itself, server, 'outer')
done()
})
})
test('error should come in the first after - one parameter', (t) => {

@@ -201,0 +252,0 @@ t.plan(3)

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