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

@fastify/autoload

Package Overview
Dependencies
Maintainers
20
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fastify/autoload - npm Package Compare versions

Comparing version 5.9.0 to 5.10.0

19

index.js

@@ -29,7 +29,2 @@ 'use strict'

let rootPrefix = options.options?.prefix ?? ''
// when prefix is provided /prefix/ format
// it is not good for concat, since most folder prefix start with /
if (rootPrefix[rootPrefix.length - 1] === '/') rootPrefix = rootPrefix.slice(0, -1)
await Promise.all(pluginArray.map(({ file, type, prefix }) => {

@@ -90,20 +85,12 @@ return loadPlugin({ file, type, directoryPrefix: prefix, options: opts, log: fastify.log })

}
registerAllPlugins(app, pluginFiles, true)
registerAllPlugins(app, pluginFiles)
}
fastify.register(composedPlugin, {
prefix: rootPrefix + replaceRouteParamPattern(prefix)
})
fastify.register(composedPlugin)
}
}
function registerAllPlugins (app, pluginFiles, composed = false) {
function registerAllPlugins (app, pluginFiles) {
for (const pluginFile of pluginFiles) {
// find plugins for this prefix, based on filename stored in registerPlugins()
const plugin = metas.find((i) => i.filename === pluginFile.file)
if (composed) {
plugin.options.prefix = undefined
}
// register plugins at fastify level

@@ -110,0 +97,0 @@ if (plugin) registerPlugin(app, plugin, pluginsMeta)

2

package.json
{
"name": "@fastify/autoload",
"version": "5.9.0",
"version": "5.10.0",
"description": "Require all plugins in a directory",

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

@@ -15,3 +15,4 @@ 'use strict'

autoHooks: true,
cascadeHooks: true
cascadeHooks: true,
routeParams: true
})

@@ -18,0 +19,0 @@

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