MCPcopy Create free account
hub / github.com/fastify/fastify / validate10

Function validate10

lib/config-validator.js:10–1262  ·  view source on GitHub ↗
(data, {instancePath="", parentData, parentDataProperty, rootData=data}={})

Source from the content-addressed store, hash-verified

8const pattern0 = new RegExp("idle", "u");
9
10function validate10(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){
11let vErrors = null;
12let errors = 0;
13if(errors === 0){
14if(data && typeof data == "object" && !Array.isArray(data)){
15if(data.connectionTimeout === undefined){
16data.connectionTimeout = 0;
17}
18if(data.keepAliveTimeout === undefined){
19data.keepAliveTimeout = 72000;
20}
21if(data.maxRequestsPerSocket === undefined){
22data.maxRequestsPerSocket = 0;
23}
24if(data.requestTimeout === undefined){
25data.requestTimeout = 0;
26}
27if(data.handlerTimeout === undefined){
28data.handlerTimeout = 0;
29}
30if(data.bodyLimit === undefined){
31data.bodyLimit = 1048576;
32}
33if(data.caseSensitive === undefined){
34data.caseSensitive = true;
35}
36if(data.allowUnsafeRegex === undefined){
37data.allowUnsafeRegex = false;
38}
39if(data.ignoreTrailingSlash === undefined){
40data.ignoreTrailingSlash = false;
41}
42if(data.ignoreDuplicateSlashes === undefined){
43data.ignoreDuplicateSlashes = false;
44}
45if(data.disableRequestLogging === undefined){
46data.disableRequestLogging = false;
47}
48if(data.maxParamLength === undefined){
49data.maxParamLength = 100;
50}
51if(data.onProtoPoisoning === undefined){
52data.onProtoPoisoning = "error";
53}
54if(data.onConstructorPoisoning === undefined){
55data.onConstructorPoisoning = "error";
56}
57if(data.pluginTimeout === undefined){
58data.pluginTimeout = 10000;
59}
60if(data.requestIdHeader === undefined){
61data.requestIdHeader = false;
62}
63if(data.requestIdLogLabel === undefined){
64data.requestIdLogLabel = "reqId";
65}
66if(data.http2SessionTimeout === undefined){
67data.http2SessionTimeout = 72000;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected