Comparing version 8.0.0 to 8.1.0
@@ -144,3 +144,3 @@ 'use strict' | ||
this.emit('close') | ||
// nooping this, we want to emit start only once | ||
// nooping this, we want to emit close only once | ||
this._closeQ.drain = noop | ||
@@ -147,0 +147,0 @@ } |
{ | ||
"name": "avvio", | ||
"version": "8.0.0", | ||
"version": "8.1.0", | ||
"description": "Asynchronous bootstrapping of Node applications", | ||
@@ -5,0 +5,0 @@ "main": "boot.js", |
@@ -10,16 +10,16 @@ 'use strict' | ||
function getName (func) { | ||
// let's see if this is a file, and in that case use that | ||
// this is common for plugins | ||
const cache = require.cache | ||
const keys = Object.keys(cache) | ||
// this symbol is assigned by fastify-plugin | ||
const kPluginMeta = Symbol.for('plugin-meta') | ||
// eslint-disable-next-line no-var | ||
for (var i = 0; i < keys.length; i++) { | ||
if (cache[keys[i]].exports === func) { | ||
return keys[i] | ||
} | ||
function getName (func, optsOrFunc) { | ||
// use explicit function metadata if set | ||
if (func[kPluginMeta] && func[kPluginMeta].name) { | ||
return func[kPluginMeta].name | ||
} | ||
// if not maybe it's a named function, so use that | ||
if (typeof optsOrFunc !== 'undefined' && typeof optsOrFunc !== 'function' && optsOrFunc.name) { | ||
return optsOrFunc.name | ||
} | ||
// use the function name if it exists | ||
if (func.name) { | ||
@@ -51,3 +51,3 @@ return func.name | ||
this.timeout = timeout === undefined ? parent._timeout : timeout | ||
this.name = getName(func) | ||
this.name = getName(func, optsOrFunc) | ||
this.isAfter = isAfter | ||
@@ -54,0 +54,0 @@ this.q = fastq(parent, loadPlugin, 1) |
'use strict' | ||
module.exports = function (app, opts, next) { | ||
module.exports = function noNext (app, opts, next) { | ||
// no call to next | ||
} |
@@ -53,3 +53,3 @@ 'use strict' | ||
t.ok(err) | ||
t.equal(err.message, message(require.resolve('./fixtures/plugin-no-next'))) | ||
t.equal(err.message, message('noNext')) | ||
t.equal(err.code, 'AVV_ERR_READY_TIMEOUT') | ||
@@ -56,0 +56,0 @@ }) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
142839
44
4845