Socket
Socket
Sign inDemoInstall

fastify-plugin

Package Overview
Dependencies
1
Maintainers
2
Versions
40
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2.1 to 1.3.0

stackParser.js

4

fastify-plugin.d.ts

@@ -21,3 +21,3 @@ /// <reference types="fastify" />

declare namespace fastifyPlugin {
type nextCallback = () => void;
type nextCallback = (err?: Error) => void;
interface PluginOptions {

@@ -38,2 +38,2 @@ /** Bare-minimum version of Fastify for your plugin, just add the semver range that you need. */

export = fastifyPlugin;
export = fastifyPlugin;

@@ -5,6 +5,4 @@ 'use strict'

const console = require('console')
const extractPluginName = require('./stackParser')
const fpStackTracePattern = new RegExp('at\\s{1}(?:.*\\.)?plugin\\s{1}.*\\n\\s*(.*)')
const fileNamePattern = new RegExp('(?:\\/|\\\\)(\\w*(\\.\\w*)*)\\..*')
function plugin (fn, options = {}) {

@@ -48,5 +46,3 @@ if (typeof fn !== 'function') {

} catch (e) {
const stack = e.stack
let m = stack.match(fpStackTracePattern)
return m ? m[1].match(fileNamePattern)[1] : 'anonymous'
return extractPluginName(e.stack)
}

@@ -53,0 +49,0 @@ }

{
"name": "fastify-plugin",
"version": "1.2.1",
"version": "1.3.0",
"description": "Plugin helper for Fastify",

@@ -28,3 +28,3 @@ "main": "index.js",

"@types/node": "^9.6.22",
"fastify": "^1.7.0",
"fastify": "^1.13.0",
"proxyquire": "^2.0.1",

@@ -31,0 +31,0 @@ "standard": "^12.0.0",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc