Aktueller Stand

This commit is contained in:
2026-01-22 19:05:45 +01:00
parent 85dee61a4d
commit e280e4eadb
1967 changed files with 397327 additions and 74093 deletions

View File

@@ -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
}