MCPcopy Index your code
hub / github.com/fastify/fast-json-stringify / validate10

Function validate10

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

Source from the content-addressed store, hash-verified

71const func0 = require("ajv/dist/runtime/equal").default;
72
73function validate10(data, {instancePath="", parentData, parentDataProperty, rootData=data}={}){
74/*# sourceURL="http://json-schema.org/draft-07/schema#" */;
75let vErrors = null;
76let errors = 0;
77if((!(data && typeof data == "object" && !Array.isArray(data))) && (typeof data !== "boolean")){
78validate10.errors = [{instancePath,schemaPath:"#/type",keyword:"type",params:{type: schema11.type},message:"must be object,boolean"}];
79return false;
80}
81if(errors === 0){
82if(data && typeof data == "object" && !Array.isArray(data)){
83if(data.$id !== undefined){
84let data0 = data.$id;
85const _errs1 = errors;
86if(errors === _errs1){
87if(errors === _errs1){
88if(typeof data0 === "string"){
89if(!(formats0.test(data0))){
90validate10.errors = [{instancePath:instancePath+"/$id",schemaPath:"#/properties/%24id/format",keyword:"format",params:{format: "uri-reference"},message:"must match format \""+"uri-reference"+"\""}];
91return false;
92}
93}
94else {
95validate10.errors = [{instancePath:instancePath+"/$id",schemaPath:"#/properties/%24id/type",keyword:"type",params:{type: "string"},message:"must be string"}];
96return false;
97}
98}
99}
100var valid0 = _errs1 === errors;
101}
102else {
103var valid0 = true;
104}
105if(valid0){
106if(data.$schema !== undefined){
107let data1 = data.$schema;
108const _errs3 = errors;
109if(errors === _errs3){
110if(errors === _errs3){
111if(typeof data1 === "string"){
112if(!(formats2(data1))){
113validate10.errors = [{instancePath:instancePath+"/$schema",schemaPath:"#/properties/%24schema/format",keyword:"format",params:{format: "uri"},message:"must match format \""+"uri"+"\""}];
114return false;
115}
116}
117else {
118validate10.errors = [{instancePath:instancePath+"/$schema",schemaPath:"#/properties/%24schema/type",keyword:"type",params:{type: "string"},message:"must be string"}];
119return false;
120}
121}
122}
123var valid0 = _errs3 === errors;
124}
125else {
126var valid0 = true;
127}
128if(valid0){
129if(data.$ref !== undefined){
130let data2 = data.$ref;

Callers

nothing calls this directly

Calls 2

validate11Function · 0.85
validate13Function · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…