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

fastify-plugin

Package Overview
Dependencies
Maintainers
2
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fastify-plugin - npm Package Compare versions

Comparing version 2.3.1 to 2.3.2

test/checkVersion.test.js

2

package.json
{
"name": "fastify-plugin",
"version": "2.3.1",
"version": "2.3.2",
"description": "Plugin helper for Fastify",

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

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

function tryGetPath (p) {
var pkgPath
try {
pkgPath = resolvePkgPath(p)
} catch (_) {
}
return pkgPath
}
function checkVersion (version, pluginName) {

@@ -90,17 +99,19 @@ if (typeof version !== 'string') {

// TODO refactor this check and move it inside Fastify itself.
// TODO refactor this check and move it inside Fastify itself. https://github.com/fastify/fastify/issues/2507
var fastifyVersion
var pkgPath
if (require.main && require.main.filename) {
// We need to dynamically compute this to support yarn pnp
pkgPath = tryGetPath(require.main.filename)
}
if (!pkgPath && process.argv[1]) {
// We need this to support native ESM context
pkgPath = tryGetPath(process.argv[1])
}
if (!pkgPath) {
// In bundlers, there is no require.main.filename so we go ahead and require directly
pkgPath = 'fastify/package.json'
}
try {
var pkgPath
if (require.main && require.main.filename) {
// We need to dynamically compute this to support yarn pnp
pkgPath = resolvePkgPath(require.main.filename)
} else if (process.argv[1]) {
// We need this to support native ESM context
pkgPath = resolvePkgPath(process.argv[1])
} else {
// In bundlers, there is no require.main.filename so we go ahead and require directly
pkgPath = 'fastify/package.json'
}
fastifyVersion = semver.coerce(require(pkgPath).version)

@@ -107,0 +118,0 @@ } catch (_) {

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