fastify 5.6.2 → 5.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/README.md +34 -33
  2. package/SECURITY.md +45 -7
  3. package/SPONSORS.md +1 -1
  4. package/build/build-validation.js +1 -2
  5. package/build/sync-version.js +0 -1
  6. package/docs/Guides/Detecting-When-Clients-Abort.md +1 -1
  7. package/docs/Guides/Ecosystem.md +12 -15
  8. package/docs/Guides/Migration-Guide-V4.md +2 -1
  9. package/docs/Guides/Migration-Guide-V5.md +9 -0
  10. package/docs/Guides/Serverless.md +25 -7
  11. package/docs/Guides/Testing.md +2 -2
  12. package/docs/Reference/Decorators.md +4 -3
  13. package/docs/Reference/Encapsulation.md +2 -2
  14. package/docs/Reference/Logging.md +4 -0
  15. package/docs/Reference/Plugins.md +2 -2
  16. package/docs/Reference/Principles.md +2 -2
  17. package/docs/Reference/Reply.md +3 -2
  18. package/docs/Reference/Server.md +35 -4
  19. package/docs/Reference/TypeScript.md +2 -1
  20. package/docs/Reference/Validation-and-Serialization.md +7 -1
  21. package/examples/benchmark/webstream.js +27 -0
  22. package/fastify.d.ts +16 -21
  23. package/fastify.js +14 -9
  24. package/lib/config-validator.js +189 -223
  25. package/lib/error-handler.js +2 -5
  26. package/lib/error-status.js +14 -0
  27. package/lib/four-oh-four.js +2 -1
  28. package/lib/handle-request.js +6 -1
  29. package/lib/reply.js +53 -3
  30. package/lib/route.js +26 -12
  31. package/lib/schema-controller.js +2 -2
  32. package/lib/wrap-thenable.js +3 -0
  33. package/package.json +4 -4
  34. package/test/404s.test.js +69 -0
  35. package/test/diagnostics-channel/error-status.test.js +84 -0
  36. package/test/internals/schema-controller-perf.test.js +40 -0
  37. package/test/issue-4959.test.js +34 -9
  38. package/test/listen.1.test.js +9 -1
  39. package/test/logger/logging.test.js +38 -1
  40. package/test/router-options.test.js +169 -0
  41. package/test/server.test.js +4 -1
  42. package/test/types/fastify.test-d.ts +28 -7
  43. package/test/types/instance.test-d.ts +29 -21
  44. package/test/types/reply.test-d.ts +55 -4
  45. package/test/types/type-provider.test-d.ts +6 -6
  46. package/test/web-api.test.js +136 -0
  47. package/types/instance.d.ts +1 -1
  48. package/types/reply.d.ts +2 -2
  49. package/types/type-provider.d.ts +16 -0
  50. package/.vscode/settings.json +0 -22
  51. package/test/decorator-namespace.test._js_ +0 -30
@@ -3,7 +3,7 @@
3
3
  "use strict";
4
4
  module.exports = validate10;
5
5
  module.exports.default = validate10;
6
- const schema11 = {"type":"object","additionalProperties":false,"properties":{"connectionTimeout":{"type":"integer","default":0},"keepAliveTimeout":{"type":"integer","default":72000},"forceCloseConnections":{"oneOf":[{"type":"string","pattern":"idle"},{"type":"boolean"}]},"maxRequestsPerSocket":{"type":"integer","default":0,"nullable":true},"requestTimeout":{"type":"integer","default":0},"bodyLimit":{"type":"integer","default":1048576},"caseSensitive":{"type":"boolean","default":true},"allowUnsafeRegex":{"type":"boolean","default":false},"http2":{"type":"boolean"},"https":{"if":{"not":{"oneOf":[{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":false,"required":["allowHTTP1"],"properties":{"allowHTTP1":{"type":"boolean"}}}]}},"then":{"setDefaultValue":true}},"ignoreTrailingSlash":{"type":"boolean","default":false},"ignoreDuplicateSlashes":{"type":"boolean","default":false},"disableRequestLogging":{"type":"boolean","default":false},"maxParamLength":{"type":"integer","default":100},"onProtoPoisoning":{"type":"string","default":"error"},"onConstructorPoisoning":{"type":"string","default":"error"},"pluginTimeout":{"type":"integer","default":10000},"requestIdHeader":{"anyOf":[{"type":"boolean"},{"type":"string"}],"default":false},"requestIdLogLabel":{"type":"string","default":"reqId"},"http2SessionTimeout":{"type":"integer","default":72000},"exposeHeadRoutes":{"type":"boolean","default":true},"useSemicolonDelimiter":{"type":"boolean","default":false},"routerOptions":{"type":"object","additionalProperties":false,"properties":{"ignoreTrailingSlash":{"type":"boolean","default":false},"ignoreDuplicateSlashes":{"type":"boolean","default":false},"maxParamLength":{"type":"integer","default":100},"allowUnsafeRegex":{"type":"boolean","default":false},"useSemicolonDelimiter":{"type":"boolean","default":false}}},"constraints":{"type":"object","additionalProperties":{"type":"object","required":["name","storage","validate","deriveConstraint"],"additionalProperties":true,"properties":{"name":{"type":"string"},"storage":{},"validate":{},"deriveConstraint":{}}}}}};
6
+ const schema11 = {"type":"object","additionalProperties":false,"properties":{"connectionTimeout":{"type":"integer","default":0},"keepAliveTimeout":{"type":"integer","default":72000},"forceCloseConnections":{"oneOf":[{"type":"string","pattern":"idle"},{"type":"boolean"}]},"maxRequestsPerSocket":{"type":"integer","default":0,"nullable":true},"requestTimeout":{"type":"integer","default":0},"bodyLimit":{"type":"integer","default":1048576},"caseSensitive":{"type":"boolean","default":true},"allowUnsafeRegex":{"type":"boolean","default":false},"http2":{"type":"boolean"},"https":{"if":{"not":{"oneOf":[{"type":"boolean"},{"type":"null"},{"type":"object","additionalProperties":false,"required":["allowHTTP1"],"properties":{"allowHTTP1":{"type":"boolean"}}}]}},"then":{"setDefaultValue":true}},"ignoreTrailingSlash":{"type":"boolean","default":false},"ignoreDuplicateSlashes":{"type":"boolean","default":false},"disableRequestLogging":{"default":false},"maxParamLength":{"type":"integer","default":100},"onProtoPoisoning":{"type":"string","default":"error"},"onConstructorPoisoning":{"type":"string","default":"error"},"pluginTimeout":{"type":"integer","default":10000},"requestIdHeader":{"anyOf":[{"type":"boolean"},{"type":"string"}],"default":false},"requestIdLogLabel":{"type":"string","default":"reqId"},"http2SessionTimeout":{"type":"integer","default":72000},"exposeHeadRoutes":{"type":"boolean","default":true},"useSemicolonDelimiter":{"type":"boolean","default":false},"routerOptions":{"type":"object","additionalProperties":true,"properties":{"ignoreTrailingSlash":{"type":"boolean","default":false},"ignoreDuplicateSlashes":{"type":"boolean","default":false},"maxParamLength":{"type":"integer","default":100},"allowUnsafeRegex":{"type":"boolean","default":false},"useSemicolonDelimiter":{"type":"boolean","default":false}}},"constraints":{"type":"object","additionalProperties":{"type":"object","required":["name","storage","validate","deriveConstraint"],"additionalProperties":true,"properties":{"name":{"type":"string"},"storage":{},"validate":{},"deriveConstraint":{}}}}}};
7
7
  const func2 = Object.prototype.hasOwnProperty;
8
8
  const pattern0 = new RegExp("idle", "u");
9
9
 
@@ -685,56 +685,57 @@ data["ignoreDuplicateSlashes"] = coerced14;
685
685
  }
686
686
  var valid0 = _errs43 === errors;
687
687
  if(valid0){
688
- let data13 = data.disableRequestLogging;
688
+ let data13 = data.maxParamLength;
689
689
  const _errs45 = errors;
690
- if(typeof data13 !== "boolean"){
690
+ if(!(((typeof data13 == "number") && (!(data13 % 1) && !isNaN(data13))) && (isFinite(data13)))){
691
+ let dataType15 = typeof data13;
691
692
  let coerced15 = undefined;
692
693
  if(!(coerced15 !== undefined)){
693
- if(data13 === "false" || data13 === 0 || data13 === null){
694
- coerced15 = false;
695
- }
696
- else if(data13 === "true" || data13 === 1){
697
- coerced15 = true;
694
+ if(dataType15 === "boolean" || data13 === null
695
+ || (dataType15 === "string" && data13 && data13 == +data13 && !(data13 % 1))){
696
+ coerced15 = +data13;
698
697
  }
699
698
  else {
700
- validate10.errors = [{instancePath:instancePath+"/disableRequestLogging",schemaPath:"#/properties/disableRequestLogging/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];
699
+ validate10.errors = [{instancePath:instancePath+"/maxParamLength",schemaPath:"#/properties/maxParamLength/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];
701
700
  return false;
702
701
  }
703
702
  }
704
703
  if(coerced15 !== undefined){
705
704
  data13 = coerced15;
706
705
  if(data !== undefined){
707
- data["disableRequestLogging"] = coerced15;
706
+ data["maxParamLength"] = coerced15;
708
707
  }
709
708
  }
710
709
  }
711
710
  var valid0 = _errs45 === errors;
712
711
  if(valid0){
713
- let data14 = data.maxParamLength;
712
+ let data14 = data.onProtoPoisoning;
714
713
  const _errs47 = errors;
715
- if(!(((typeof data14 == "number") && (!(data14 % 1) && !isNaN(data14))) && (isFinite(data14)))){
714
+ if(typeof data14 !== "string"){
716
715
  let dataType16 = typeof data14;
717
716
  let coerced16 = undefined;
718
717
  if(!(coerced16 !== undefined)){
719
- if(dataType16 === "boolean" || data14 === null
720
- || (dataType16 === "string" && data14 && data14 == +data14 && !(data14 % 1))){
721
- coerced16 = +data14;
718
+ if(dataType16 == "number" || dataType16 == "boolean"){
719
+ coerced16 = "" + data14;
720
+ }
721
+ else if(data14 === null){
722
+ coerced16 = "";
722
723
  }
723
724
  else {
724
- validate10.errors = [{instancePath:instancePath+"/maxParamLength",schemaPath:"#/properties/maxParamLength/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];
725
+ validate10.errors = [{instancePath:instancePath+"/onProtoPoisoning",schemaPath:"#/properties/onProtoPoisoning/type",keyword:"type",params:{type: "string"},message:"must be string"}];
725
726
  return false;
726
727
  }
727
728
  }
728
729
  if(coerced16 !== undefined){
729
730
  data14 = coerced16;
730
731
  if(data !== undefined){
731
- data["maxParamLength"] = coerced16;
732
+ data["onProtoPoisoning"] = coerced16;
732
733
  }
733
734
  }
734
735
  }
735
736
  var valid0 = _errs47 === errors;
736
737
  if(valid0){
737
- let data15 = data.onProtoPoisoning;
738
+ let data15 = data.onConstructorPoisoning;
738
739
  const _errs49 = errors;
739
740
  if(typeof data15 !== "string"){
740
741
  let dataType17 = typeof data15;
@@ -747,82 +748,56 @@ else if(data15 === null){
747
748
  coerced17 = "";
748
749
  }
749
750
  else {
750
- validate10.errors = [{instancePath:instancePath+"/onProtoPoisoning",schemaPath:"#/properties/onProtoPoisoning/type",keyword:"type",params:{type: "string"},message:"must be string"}];
751
+ validate10.errors = [{instancePath:instancePath+"/onConstructorPoisoning",schemaPath:"#/properties/onConstructorPoisoning/type",keyword:"type",params:{type: "string"},message:"must be string"}];
751
752
  return false;
752
753
  }
753
754
  }
754
755
  if(coerced17 !== undefined){
755
756
  data15 = coerced17;
756
757
  if(data !== undefined){
757
- data["onProtoPoisoning"] = coerced17;
758
+ data["onConstructorPoisoning"] = coerced17;
758
759
  }
759
760
  }
760
761
  }
761
762
  var valid0 = _errs49 === errors;
762
763
  if(valid0){
763
- let data16 = data.onConstructorPoisoning;
764
+ let data16 = data.pluginTimeout;
764
765
  const _errs51 = errors;
765
- if(typeof data16 !== "string"){
766
+ if(!(((typeof data16 == "number") && (!(data16 % 1) && !isNaN(data16))) && (isFinite(data16)))){
766
767
  let dataType18 = typeof data16;
767
768
  let coerced18 = undefined;
768
769
  if(!(coerced18 !== undefined)){
769
- if(dataType18 == "number" || dataType18 == "boolean"){
770
- coerced18 = "" + data16;
771
- }
772
- else if(data16 === null){
773
- coerced18 = "";
770
+ if(dataType18 === "boolean" || data16 === null
771
+ || (dataType18 === "string" && data16 && data16 == +data16 && !(data16 % 1))){
772
+ coerced18 = +data16;
774
773
  }
775
774
  else {
776
- validate10.errors = [{instancePath:instancePath+"/onConstructorPoisoning",schemaPath:"#/properties/onConstructorPoisoning/type",keyword:"type",params:{type: "string"},message:"must be string"}];
775
+ validate10.errors = [{instancePath:instancePath+"/pluginTimeout",schemaPath:"#/properties/pluginTimeout/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];
777
776
  return false;
778
777
  }
779
778
  }
780
779
  if(coerced18 !== undefined){
781
780
  data16 = coerced18;
782
781
  if(data !== undefined){
783
- data["onConstructorPoisoning"] = coerced18;
782
+ data["pluginTimeout"] = coerced18;
784
783
  }
785
784
  }
786
785
  }
787
786
  var valid0 = _errs51 === errors;
788
787
  if(valid0){
789
- let data17 = data.pluginTimeout;
788
+ let data17 = data.requestIdHeader;
790
789
  const _errs53 = errors;
791
- if(!(((typeof data17 == "number") && (!(data17 % 1) && !isNaN(data17))) && (isFinite(data17)))){
792
- let dataType19 = typeof data17;
790
+ const _errs54 = errors;
791
+ let valid6 = false;
792
+ const _errs55 = errors;
793
+ if(typeof data17 !== "boolean"){
793
794
  let coerced19 = undefined;
794
795
  if(!(coerced19 !== undefined)){
795
- if(dataType19 === "boolean" || data17 === null
796
- || (dataType19 === "string" && data17 && data17 == +data17 && !(data17 % 1))){
797
- coerced19 = +data17;
798
- }
799
- else {
800
- validate10.errors = [{instancePath:instancePath+"/pluginTimeout",schemaPath:"#/properties/pluginTimeout/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];
801
- return false;
796
+ if(data17 === "false" || data17 === 0 || data17 === null){
797
+ coerced19 = false;
802
798
  }
803
- }
804
- if(coerced19 !== undefined){
805
- data17 = coerced19;
806
- if(data !== undefined){
807
- data["pluginTimeout"] = coerced19;
808
- }
809
- }
810
- }
811
- var valid0 = _errs53 === errors;
812
- if(valid0){
813
- let data18 = data.requestIdHeader;
814
- const _errs55 = errors;
815
- const _errs56 = errors;
816
- let valid6 = false;
817
- const _errs57 = errors;
818
- if(typeof data18 !== "boolean"){
819
- let coerced20 = undefined;
820
- if(!(coerced20 !== undefined)){
821
- if(data18 === "false" || data18 === 0 || data18 === null){
822
- coerced20 = false;
823
- }
824
- else if(data18 === "true" || data18 === 1){
825
- coerced20 = true;
799
+ else if(data17 === "true" || data17 === 1){
800
+ coerced19 = true;
826
801
  }
827
802
  else {
828
803
  const err12 = {instancePath:instancePath+"/requestIdHeader",schemaPath:"#/properties/requestIdHeader/anyOf/0/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};
@@ -835,26 +810,26 @@ vErrors.push(err12);
835
810
  errors++;
836
811
  }
837
812
  }
838
- if(coerced20 !== undefined){
839
- data18 = coerced20;
813
+ if(coerced19 !== undefined){
814
+ data17 = coerced19;
840
815
  if(data !== undefined){
841
- data["requestIdHeader"] = coerced20;
816
+ data["requestIdHeader"] = coerced19;
842
817
  }
843
818
  }
844
819
  }
845
- var _valid3 = _errs57 === errors;
820
+ var _valid3 = _errs55 === errors;
846
821
  valid6 = valid6 || _valid3;
847
822
  if(!valid6){
848
- const _errs59 = errors;
849
- if(typeof data18 !== "string"){
850
- let dataType21 = typeof data18;
851
- let coerced21 = undefined;
852
- if(!(coerced21 !== undefined)){
853
- if(dataType21 == "number" || dataType21 == "boolean"){
854
- coerced21 = "" + data18;
823
+ const _errs57 = errors;
824
+ if(typeof data17 !== "string"){
825
+ let dataType20 = typeof data17;
826
+ let coerced20 = undefined;
827
+ if(!(coerced20 !== undefined)){
828
+ if(dataType20 == "number" || dataType20 == "boolean"){
829
+ coerced20 = "" + data17;
855
830
  }
856
- else if(data18 === null){
857
- coerced21 = "";
831
+ else if(data17 === null){
832
+ coerced20 = "";
858
833
  }
859
834
  else {
860
835
  const err13 = {instancePath:instancePath+"/requestIdHeader",schemaPath:"#/properties/requestIdHeader/anyOf/1/type",keyword:"type",params:{type: "string"},message:"must be string"};
@@ -867,14 +842,14 @@ vErrors.push(err13);
867
842
  errors++;
868
843
  }
869
844
  }
870
- if(coerced21 !== undefined){
871
- data18 = coerced21;
845
+ if(coerced20 !== undefined){
846
+ data17 = coerced20;
872
847
  if(data !== undefined){
873
- data["requestIdHeader"] = coerced21;
848
+ data["requestIdHeader"] = coerced20;
874
849
  }
875
850
  }
876
851
  }
877
- var _valid3 = _errs59 === errors;
852
+ var _valid3 = _errs57 === errors;
878
853
  valid6 = valid6 || _valid3;
879
854
  }
880
855
  if(!valid6){
@@ -890,69 +865,94 @@ validate10.errors = vErrors;
890
865
  return false;
891
866
  }
892
867
  else {
893
- errors = _errs56;
868
+ errors = _errs54;
894
869
  if(vErrors !== null){
895
- if(_errs56){
896
- vErrors.length = _errs56;
870
+ if(_errs54){
871
+ vErrors.length = _errs54;
897
872
  }
898
873
  else {
899
874
  vErrors = null;
900
875
  }
901
876
  }
902
877
  }
903
- var valid0 = _errs55 === errors;
878
+ var valid0 = _errs53 === errors;
904
879
  if(valid0){
905
- let data19 = data.requestIdLogLabel;
880
+ let data18 = data.requestIdLogLabel;
881
+ const _errs59 = errors;
882
+ if(typeof data18 !== "string"){
883
+ let dataType21 = typeof data18;
884
+ let coerced21 = undefined;
885
+ if(!(coerced21 !== undefined)){
886
+ if(dataType21 == "number" || dataType21 == "boolean"){
887
+ coerced21 = "" + data18;
888
+ }
889
+ else if(data18 === null){
890
+ coerced21 = "";
891
+ }
892
+ else {
893
+ validate10.errors = [{instancePath:instancePath+"/requestIdLogLabel",schemaPath:"#/properties/requestIdLogLabel/type",keyword:"type",params:{type: "string"},message:"must be string"}];
894
+ return false;
895
+ }
896
+ }
897
+ if(coerced21 !== undefined){
898
+ data18 = coerced21;
899
+ if(data !== undefined){
900
+ data["requestIdLogLabel"] = coerced21;
901
+ }
902
+ }
903
+ }
904
+ var valid0 = _errs59 === errors;
905
+ if(valid0){
906
+ let data19 = data.http2SessionTimeout;
906
907
  const _errs61 = errors;
907
- if(typeof data19 !== "string"){
908
+ if(!(((typeof data19 == "number") && (!(data19 % 1) && !isNaN(data19))) && (isFinite(data19)))){
908
909
  let dataType22 = typeof data19;
909
910
  let coerced22 = undefined;
910
911
  if(!(coerced22 !== undefined)){
911
- if(dataType22 == "number" || dataType22 == "boolean"){
912
- coerced22 = "" + data19;
913
- }
914
- else if(data19 === null){
915
- coerced22 = "";
912
+ if(dataType22 === "boolean" || data19 === null
913
+ || (dataType22 === "string" && data19 && data19 == +data19 && !(data19 % 1))){
914
+ coerced22 = +data19;
916
915
  }
917
916
  else {
918
- validate10.errors = [{instancePath:instancePath+"/requestIdLogLabel",schemaPath:"#/properties/requestIdLogLabel/type",keyword:"type",params:{type: "string"},message:"must be string"}];
917
+ validate10.errors = [{instancePath:instancePath+"/http2SessionTimeout",schemaPath:"#/properties/http2SessionTimeout/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];
919
918
  return false;
920
919
  }
921
920
  }
922
921
  if(coerced22 !== undefined){
923
922
  data19 = coerced22;
924
923
  if(data !== undefined){
925
- data["requestIdLogLabel"] = coerced22;
924
+ data["http2SessionTimeout"] = coerced22;
926
925
  }
927
926
  }
928
927
  }
929
928
  var valid0 = _errs61 === errors;
930
929
  if(valid0){
931
- let data20 = data.http2SessionTimeout;
930
+ let data20 = data.exposeHeadRoutes;
932
931
  const _errs63 = errors;
933
- if(!(((typeof data20 == "number") && (!(data20 % 1) && !isNaN(data20))) && (isFinite(data20)))){
934
- let dataType23 = typeof data20;
932
+ if(typeof data20 !== "boolean"){
935
933
  let coerced23 = undefined;
936
934
  if(!(coerced23 !== undefined)){
937
- if(dataType23 === "boolean" || data20 === null
938
- || (dataType23 === "string" && data20 && data20 == +data20 && !(data20 % 1))){
939
- coerced23 = +data20;
935
+ if(data20 === "false" || data20 === 0 || data20 === null){
936
+ coerced23 = false;
937
+ }
938
+ else if(data20 === "true" || data20 === 1){
939
+ coerced23 = true;
940
940
  }
941
941
  else {
942
- validate10.errors = [{instancePath:instancePath+"/http2SessionTimeout",schemaPath:"#/properties/http2SessionTimeout/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];
942
+ validate10.errors = [{instancePath:instancePath+"/exposeHeadRoutes",schemaPath:"#/properties/exposeHeadRoutes/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];
943
943
  return false;
944
944
  }
945
945
  }
946
946
  if(coerced23 !== undefined){
947
947
  data20 = coerced23;
948
948
  if(data !== undefined){
949
- data["http2SessionTimeout"] = coerced23;
949
+ data["exposeHeadRoutes"] = coerced23;
950
950
  }
951
951
  }
952
952
  }
953
953
  var valid0 = _errs63 === errors;
954
954
  if(valid0){
955
- let data21 = data.exposeHeadRoutes;
955
+ let data21 = data.useSemicolonDelimiter;
956
956
  const _errs65 = errors;
957
957
  if(typeof data21 !== "boolean"){
958
958
  let coerced24 = undefined;
@@ -964,72 +964,65 @@ else if(data21 === "true" || data21 === 1){
964
964
  coerced24 = true;
965
965
  }
966
966
  else {
967
- validate10.errors = [{instancePath:instancePath+"/exposeHeadRoutes",schemaPath:"#/properties/exposeHeadRoutes/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];
967
+ validate10.errors = [{instancePath:instancePath+"/useSemicolonDelimiter",schemaPath:"#/properties/useSemicolonDelimiter/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];
968
968
  return false;
969
969
  }
970
970
  }
971
971
  if(coerced24 !== undefined){
972
972
  data21 = coerced24;
973
973
  if(data !== undefined){
974
- data["exposeHeadRoutes"] = coerced24;
974
+ data["useSemicolonDelimiter"] = coerced24;
975
975
  }
976
976
  }
977
977
  }
978
978
  var valid0 = _errs65 === errors;
979
979
  if(valid0){
980
- let data22 = data.useSemicolonDelimiter;
980
+ if(data.routerOptions !== undefined){
981
+ let data22 = data.routerOptions;
981
982
  const _errs67 = errors;
982
- if(typeof data22 !== "boolean"){
983
+ if(errors === _errs67){
984
+ if(data22 && typeof data22 == "object" && !Array.isArray(data22)){
985
+ if(data22.ignoreTrailingSlash === undefined){
986
+ data22.ignoreTrailingSlash = false;
987
+ }
988
+ if(data22.ignoreDuplicateSlashes === undefined){
989
+ data22.ignoreDuplicateSlashes = false;
990
+ }
991
+ if(data22.maxParamLength === undefined){
992
+ data22.maxParamLength = 100;
993
+ }
994
+ if(data22.allowUnsafeRegex === undefined){
995
+ data22.allowUnsafeRegex = false;
996
+ }
997
+ if(data22.useSemicolonDelimiter === undefined){
998
+ data22.useSemicolonDelimiter = false;
999
+ }
1000
+ let data23 = data22.ignoreTrailingSlash;
1001
+ const _errs70 = errors;
1002
+ if(typeof data23 !== "boolean"){
983
1003
  let coerced25 = undefined;
984
1004
  if(!(coerced25 !== undefined)){
985
- if(data22 === "false" || data22 === 0 || data22 === null){
1005
+ if(data23 === "false" || data23 === 0 || data23 === null){
986
1006
  coerced25 = false;
987
1007
  }
988
- else if(data22 === "true" || data22 === 1){
1008
+ else if(data23 === "true" || data23 === 1){
989
1009
  coerced25 = true;
990
1010
  }
991
1011
  else {
992
- validate10.errors = [{instancePath:instancePath+"/useSemicolonDelimiter",schemaPath:"#/properties/useSemicolonDelimiter/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];
1012
+ validate10.errors = [{instancePath:instancePath+"/routerOptions/ignoreTrailingSlash",schemaPath:"#/properties/routerOptions/properties/ignoreTrailingSlash/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];
993
1013
  return false;
994
1014
  }
995
1015
  }
996
1016
  if(coerced25 !== undefined){
997
- data22 = coerced25;
998
- if(data !== undefined){
999
- data["useSemicolonDelimiter"] = coerced25;
1000
- }
1001
- }
1002
- }
1003
- var valid0 = _errs67 === errors;
1004
- if(valid0){
1005
- if(data.routerOptions !== undefined){
1006
- let data23 = data.routerOptions;
1007
- const _errs69 = errors;
1008
- if(errors === _errs69){
1009
- if(data23 && typeof data23 == "object" && !Array.isArray(data23)){
1010
- if(data23.ignoreTrailingSlash === undefined){
1011
- data23.ignoreTrailingSlash = false;
1012
- }
1013
- if(data23.ignoreDuplicateSlashes === undefined){
1014
- data23.ignoreDuplicateSlashes = false;
1015
- }
1016
- if(data23.maxParamLength === undefined){
1017
- data23.maxParamLength = 100;
1018
- }
1019
- if(data23.allowUnsafeRegex === undefined){
1020
- data23.allowUnsafeRegex = false;
1017
+ data23 = coerced25;
1018
+ if(data22 !== undefined){
1019
+ data22["ignoreTrailingSlash"] = coerced25;
1021
1020
  }
1022
- if(data23.useSemicolonDelimiter === undefined){
1023
- data23.useSemicolonDelimiter = false;
1024
1021
  }
1025
- const _errs71 = errors;
1026
- for(const key2 in data23){
1027
- if(!(((((key2 === "ignoreTrailingSlash") || (key2 === "ignoreDuplicateSlashes")) || (key2 === "maxParamLength")) || (key2 === "allowUnsafeRegex")) || (key2 === "useSemicolonDelimiter"))){
1028
- delete data23[key2];
1029
1022
  }
1030
- }
1031
- if(_errs71 === errors){
1032
- let data24 = data23.ignoreTrailingSlash;
1023
+ var valid7 = _errs70 === errors;
1024
+ if(valid7){
1025
+ let data24 = data22.ignoreDuplicateSlashes;
1033
1026
  const _errs72 = errors;
1034
1027
  if(typeof data24 !== "boolean"){
1035
1028
  let coerced26 = undefined;
@@ -1041,69 +1034,69 @@ else if(data24 === "true" || data24 === 1){
1041
1034
  coerced26 = true;
1042
1035
  }
1043
1036
  else {
1044
- validate10.errors = [{instancePath:instancePath+"/routerOptions/ignoreTrailingSlash",schemaPath:"#/properties/routerOptions/properties/ignoreTrailingSlash/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];
1037
+ validate10.errors = [{instancePath:instancePath+"/routerOptions/ignoreDuplicateSlashes",schemaPath:"#/properties/routerOptions/properties/ignoreDuplicateSlashes/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];
1045
1038
  return false;
1046
1039
  }
1047
1040
  }
1048
1041
  if(coerced26 !== undefined){
1049
1042
  data24 = coerced26;
1050
- if(data23 !== undefined){
1051
- data23["ignoreTrailingSlash"] = coerced26;
1043
+ if(data22 !== undefined){
1044
+ data22["ignoreDuplicateSlashes"] = coerced26;
1052
1045
  }
1053
1046
  }
1054
1047
  }
1055
1048
  var valid7 = _errs72 === errors;
1056
1049
  if(valid7){
1057
- let data25 = data23.ignoreDuplicateSlashes;
1050
+ let data25 = data22.maxParamLength;
1058
1051
  const _errs74 = errors;
1059
- if(typeof data25 !== "boolean"){
1052
+ if(!(((typeof data25 == "number") && (!(data25 % 1) && !isNaN(data25))) && (isFinite(data25)))){
1053
+ let dataType27 = typeof data25;
1060
1054
  let coerced27 = undefined;
1061
1055
  if(!(coerced27 !== undefined)){
1062
- if(data25 === "false" || data25 === 0 || data25 === null){
1063
- coerced27 = false;
1064
- }
1065
- else if(data25 === "true" || data25 === 1){
1066
- coerced27 = true;
1056
+ if(dataType27 === "boolean" || data25 === null
1057
+ || (dataType27 === "string" && data25 && data25 == +data25 && !(data25 % 1))){
1058
+ coerced27 = +data25;
1067
1059
  }
1068
1060
  else {
1069
- validate10.errors = [{instancePath:instancePath+"/routerOptions/ignoreDuplicateSlashes",schemaPath:"#/properties/routerOptions/properties/ignoreDuplicateSlashes/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];
1061
+ validate10.errors = [{instancePath:instancePath+"/routerOptions/maxParamLength",schemaPath:"#/properties/routerOptions/properties/maxParamLength/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];
1070
1062
  return false;
1071
1063
  }
1072
1064
  }
1073
1065
  if(coerced27 !== undefined){
1074
1066
  data25 = coerced27;
1075
- if(data23 !== undefined){
1076
- data23["ignoreDuplicateSlashes"] = coerced27;
1067
+ if(data22 !== undefined){
1068
+ data22["maxParamLength"] = coerced27;
1077
1069
  }
1078
1070
  }
1079
1071
  }
1080
1072
  var valid7 = _errs74 === errors;
1081
1073
  if(valid7){
1082
- let data26 = data23.maxParamLength;
1074
+ let data26 = data22.allowUnsafeRegex;
1083
1075
  const _errs76 = errors;
1084
- if(!(((typeof data26 == "number") && (!(data26 % 1) && !isNaN(data26))) && (isFinite(data26)))){
1085
- let dataType28 = typeof data26;
1076
+ if(typeof data26 !== "boolean"){
1086
1077
  let coerced28 = undefined;
1087
1078
  if(!(coerced28 !== undefined)){
1088
- if(dataType28 === "boolean" || data26 === null
1089
- || (dataType28 === "string" && data26 && data26 == +data26 && !(data26 % 1))){
1090
- coerced28 = +data26;
1079
+ if(data26 === "false" || data26 === 0 || data26 === null){
1080
+ coerced28 = false;
1081
+ }
1082
+ else if(data26 === "true" || data26 === 1){
1083
+ coerced28 = true;
1091
1084
  }
1092
1085
  else {
1093
- validate10.errors = [{instancePath:instancePath+"/routerOptions/maxParamLength",schemaPath:"#/properties/routerOptions/properties/maxParamLength/type",keyword:"type",params:{type: "integer"},message:"must be integer"}];
1086
+ validate10.errors = [{instancePath:instancePath+"/routerOptions/allowUnsafeRegex",schemaPath:"#/properties/routerOptions/properties/allowUnsafeRegex/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];
1094
1087
  return false;
1095
1088
  }
1096
1089
  }
1097
1090
  if(coerced28 !== undefined){
1098
1091
  data26 = coerced28;
1099
- if(data23 !== undefined){
1100
- data23["maxParamLength"] = coerced28;
1092
+ if(data22 !== undefined){
1093
+ data22["allowUnsafeRegex"] = coerced28;
1101
1094
  }
1102
1095
  }
1103
1096
  }
1104
1097
  var valid7 = _errs76 === errors;
1105
1098
  if(valid7){
1106
- let data27 = data23.allowUnsafeRegex;
1099
+ let data27 = data22.useSemicolonDelimiter;
1107
1100
  const _errs78 = errors;
1108
1101
  if(typeof data27 !== "boolean"){
1109
1102
  let coerced29 = undefined;
@@ -1115,44 +1108,18 @@ else if(data27 === "true" || data27 === 1){
1115
1108
  coerced29 = true;
1116
1109
  }
1117
1110
  else {
1118
- validate10.errors = [{instancePath:instancePath+"/routerOptions/allowUnsafeRegex",schemaPath:"#/properties/routerOptions/properties/allowUnsafeRegex/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];
1111
+ validate10.errors = [{instancePath:instancePath+"/routerOptions/useSemicolonDelimiter",schemaPath:"#/properties/routerOptions/properties/useSemicolonDelimiter/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];
1119
1112
  return false;
1120
1113
  }
1121
1114
  }
1122
1115
  if(coerced29 !== undefined){
1123
1116
  data27 = coerced29;
1124
- if(data23 !== undefined){
1125
- data23["allowUnsafeRegex"] = coerced29;
1117
+ if(data22 !== undefined){
1118
+ data22["useSemicolonDelimiter"] = coerced29;
1126
1119
  }
1127
1120
  }
1128
1121
  }
1129
1122
  var valid7 = _errs78 === errors;
1130
- if(valid7){
1131
- let data28 = data23.useSemicolonDelimiter;
1132
- const _errs80 = errors;
1133
- if(typeof data28 !== "boolean"){
1134
- let coerced30 = undefined;
1135
- if(!(coerced30 !== undefined)){
1136
- if(data28 === "false" || data28 === 0 || data28 === null){
1137
- coerced30 = false;
1138
- }
1139
- else if(data28 === "true" || data28 === 1){
1140
- coerced30 = true;
1141
- }
1142
- else {
1143
- validate10.errors = [{instancePath:instancePath+"/routerOptions/useSemicolonDelimiter",schemaPath:"#/properties/routerOptions/properties/useSemicolonDelimiter/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"}];
1144
- return false;
1145
- }
1146
- }
1147
- if(coerced30 !== undefined){
1148
- data28 = coerced30;
1149
- if(data23 !== undefined){
1150
- data23["useSemicolonDelimiter"] = coerced30;
1151
- }
1152
- }
1153
- }
1154
- var valid7 = _errs80 === errors;
1155
- }
1156
1123
  }
1157
1124
  }
1158
1125
  }
@@ -1163,49 +1130,49 @@ validate10.errors = [{instancePath:instancePath+"/routerOptions",schemaPath:"#/p
1163
1130
  return false;
1164
1131
  }
1165
1132
  }
1166
- var valid0 = _errs69 === errors;
1133
+ var valid0 = _errs67 === errors;
1167
1134
  }
1168
1135
  else {
1169
1136
  var valid0 = true;
1170
1137
  }
1171
1138
  if(valid0){
1172
1139
  if(data.constraints !== undefined){
1173
- let data29 = data.constraints;
1174
- const _errs82 = errors;
1175
- if(errors === _errs82){
1140
+ let data28 = data.constraints;
1141
+ const _errs80 = errors;
1142
+ if(errors === _errs80){
1143
+ if(data28 && typeof data28 == "object" && !Array.isArray(data28)){
1144
+ for(const key2 in data28){
1145
+ let data29 = data28[key2];
1146
+ const _errs83 = errors;
1147
+ if(errors === _errs83){
1176
1148
  if(data29 && typeof data29 == "object" && !Array.isArray(data29)){
1177
- for(const key3 in data29){
1178
- let data30 = data29[key3];
1179
- const _errs85 = errors;
1180
- if(errors === _errs85){
1181
- if(data30 && typeof data30 == "object" && !Array.isArray(data30)){
1182
1149
  let missing1;
1183
- if(((((data30.name === undefined) && (missing1 = "name")) || ((data30.storage === undefined) && (missing1 = "storage"))) || ((data30.validate === undefined) && (missing1 = "validate"))) || ((data30.deriveConstraint === undefined) && (missing1 = "deriveConstraint"))){
1184
- validate10.errors = [{instancePath:instancePath+"/constraints/" + key3.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/properties/constraints/additionalProperties/required",keyword:"required",params:{missingProperty: missing1},message:"must have required property '"+missing1+"'"}];
1150
+ if(((((data29.name === undefined) && (missing1 = "name")) || ((data29.storage === undefined) && (missing1 = "storage"))) || ((data29.validate === undefined) && (missing1 = "validate"))) || ((data29.deriveConstraint === undefined) && (missing1 = "deriveConstraint"))){
1151
+ validate10.errors = [{instancePath:instancePath+"/constraints/" + key2.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/properties/constraints/additionalProperties/required",keyword:"required",params:{missingProperty: missing1},message:"must have required property '"+missing1+"'"}];
1185
1152
  return false;
1186
1153
  }
1187
1154
  else {
1188
- if(data30.name !== undefined){
1189
- let data31 = data30.name;
1190
- if(typeof data31 !== "string"){
1191
- let dataType31 = typeof data31;
1192
- let coerced31 = undefined;
1193
- if(!(coerced31 !== undefined)){
1194
- if(dataType31 == "number" || dataType31 == "boolean"){
1195
- coerced31 = "" + data31;
1155
+ if(data29.name !== undefined){
1156
+ let data30 = data29.name;
1157
+ if(typeof data30 !== "string"){
1158
+ let dataType30 = typeof data30;
1159
+ let coerced30 = undefined;
1160
+ if(!(coerced30 !== undefined)){
1161
+ if(dataType30 == "number" || dataType30 == "boolean"){
1162
+ coerced30 = "" + data30;
1196
1163
  }
1197
- else if(data31 === null){
1198
- coerced31 = "";
1164
+ else if(data30 === null){
1165
+ coerced30 = "";
1199
1166
  }
1200
1167
  else {
1201
- validate10.errors = [{instancePath:instancePath+"/constraints/" + key3.replace(/~/g, "~0").replace(/\//g, "~1")+"/name",schemaPath:"#/properties/constraints/additionalProperties/properties/name/type",keyword:"type",params:{type: "string"},message:"must be string"}];
1168
+ validate10.errors = [{instancePath:instancePath+"/constraints/" + key2.replace(/~/g, "~0").replace(/\//g, "~1")+"/name",schemaPath:"#/properties/constraints/additionalProperties/properties/name/type",keyword:"type",params:{type: "string"},message:"must be string"}];
1202
1169
  return false;
1203
1170
  }
1204
1171
  }
1205
- if(coerced31 !== undefined){
1206
- data31 = coerced31;
1207
- if(data30 !== undefined){
1208
- data30["name"] = coerced31;
1172
+ if(coerced30 !== undefined){
1173
+ data30 = coerced30;
1174
+ if(data29 !== undefined){
1175
+ data29["name"] = coerced30;
1209
1176
  }
1210
1177
  }
1211
1178
  }
@@ -1213,11 +1180,11 @@ data30["name"] = coerced31;
1213
1180
  }
1214
1181
  }
1215
1182
  else {
1216
- validate10.errors = [{instancePath:instancePath+"/constraints/" + key3.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/properties/constraints/additionalProperties/type",keyword:"type",params:{type: "object"},message:"must be object"}];
1183
+ validate10.errors = [{instancePath:instancePath+"/constraints/" + key2.replace(/~/g, "~0").replace(/\//g, "~1"),schemaPath:"#/properties/constraints/additionalProperties/type",keyword:"type",params:{type: "object"},message:"must be object"}];
1217
1184
  return false;
1218
1185
  }
1219
1186
  }
1220
- var valid8 = _errs85 === errors;
1187
+ var valid8 = _errs83 === errors;
1221
1188
  if(!valid8){
1222
1189
  break;
1223
1190
  }
@@ -1228,7 +1195,7 @@ validate10.errors = [{instancePath:instancePath+"/constraints",schemaPath:"#/pro
1228
1195
  return false;
1229
1196
  }
1230
1197
  }
1231
- var valid0 = _errs82 === errors;
1198
+ var valid0 = _errs80 === errors;
1232
1199
  }
1233
1200
  else {
1234
1201
  var valid0 = true;
@@ -1257,7 +1224,6 @@ var valid0 = true;
1257
1224
  }
1258
1225
  }
1259
1226
  }
1260
- }
1261
1227
  else {
1262
1228
  validate10.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"}];
1263
1229
  return false;