完整代码加修复数据库连接字符串!!!

This commit is contained in:
heiye111
2025-09-20 23:02:18 +08:00
parent 48600edffc
commit 9f0b5a2e61
29 changed files with 1556 additions and 1 deletions

25
node_modules/fastify-plugin/lib/getPluginName.js generated vendored Normal file
View File

@@ -0,0 +1,25 @@
'use strict'
const fpStackTracePattern = /at\s{1}(?:.*\.)?plugin\s{1}.*\n\s*(.*)/
const fileNamePattern = /(\w*(\.\w*)*)\..*/
module.exports = function getPluginName (fn) {
if (fn.name.length > 0) return fn.name
const stackTraceLimit = Error.stackTraceLimit
Error.stackTraceLimit = 10
try {
throw new Error('anonymous function')
} catch (e) {
Error.stackTraceLimit = stackTraceLimit
return extractPluginName(e.stack)
}
}
function extractPluginName (stack) {
const m = stack.match(fpStackTracePattern)
// get last section of path and match for filename
return m ? m[1].split(/[/\\]/).slice(-1)[0].match(fileNamePattern)[1] : 'anonymous'
}
module.exports.extractPluginName = extractPluginName