fastify-plugin
Advanced tools
Comparing version 1.1.2 to 1.1.3
@@ -7,4 +7,4 @@ 'use strict' | ||
const DISPLAY_NAME_SYMBOL = Symbol.for('fastify.display-name') | ||
const fpStackTracePattern = new RegExp('at\\s{1}plugin\\s{1}.*\\n\\s*(.*)') | ||
const fileNamePattern = new RegExp('(?:\\/|\\\\)(\\w*(\\.\\w*)*)\\.js') | ||
const fpStackTracePattern = new RegExp('at\\s{1}(?:.*\\.)?plugin\\s{1}.*\\n\\s*(.*)') | ||
const fileNamePattern = new RegExp('(?:\\/|\\\\)(\\w*(\\.\\w*)*)\\..*') | ||
@@ -49,4 +49,3 @@ function plugin (fn, options) { | ||
let m = stack.match(fpStackTracePattern) | ||
m = m[1].match(fileNamePattern)[1] | ||
return m | ||
return m ? m[1].match(fileNamePattern)[1] : 'anonymous' | ||
} | ||
@@ -53,0 +52,0 @@ } |
{ | ||
"name": "fastify-plugin", | ||
"version": "1.1.2", | ||
"version": "1.1.3", | ||
"description": "Plugin helper for Fastify", | ||
@@ -9,3 +9,3 @@ "main": "index.js", | ||
"typescript": "tsc --project ./tsconfig.json", | ||
"test": "standard && tap test/* && npm run typescript" | ||
"test": "standard && tap test/*.js && npm run typescript" | ||
}, | ||
@@ -33,2 +33,3 @@ "repository": { | ||
"tap": "^12.0.0", | ||
"ts-node": "^6.1.1", | ||
"typescript": "^2.9.1" | ||
@@ -35,0 +36,0 @@ }, |
@@ -7,2 +7,3 @@ { | ||
"strict": true, | ||
"noImplicitAny": false, | ||
}, | ||
@@ -9,0 +10,0 @@ "files": [ |
13855
16
321
7