Aktueller Stand
This commit is contained in:
26
backend/node_modules/fastify/lib/context.js
generated
vendored
26
backend/node_modules/fastify/lib/context.js
generated
vendored
@@ -14,8 +14,7 @@ const {
|
||||
kContentTypeParser,
|
||||
kRouteByFastify,
|
||||
kRequestCacheValidateFns,
|
||||
kReplyCacheSerializeFns,
|
||||
kPublicRouteContext
|
||||
kReplyCacheSerializeFns
|
||||
} = require('./symbols.js')
|
||||
|
||||
// Object that holds the context of every request
|
||||
@@ -79,35 +78,14 @@ function Context ({
|
||||
this.validatorCompiler = validatorCompiler || null
|
||||
this.serializerCompiler = serializerCompiler || null
|
||||
|
||||
// Route + Userland configurations for the route
|
||||
this[kPublicRouteContext] = getPublicRouteContext(this)
|
||||
|
||||
this.server = server
|
||||
}
|
||||
|
||||
function getPublicRouteContext (context) {
|
||||
return Object.create(null, {
|
||||
schema: {
|
||||
enumerable: true,
|
||||
get () {
|
||||
return context.schema
|
||||
}
|
||||
},
|
||||
config: {
|
||||
enumerable: true,
|
||||
get () {
|
||||
return context.config
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function defaultSchemaErrorFormatter (errors, dataVar) {
|
||||
let text = ''
|
||||
const separator = ', '
|
||||
|
||||
// eslint-disable-next-line no-var
|
||||
for (var i = 0; i !== errors.length; ++i) {
|
||||
for (let i = 0; i !== errors.length; ++i) {
|
||||
const e = errors[i]
|
||||
text += dataVar + (e.instancePath || '') + ' ' + e.message + separator
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user