MCPcopy Create free account
hub / github.com/json-editor/json-editor / check$data

Method check$data

docs/scripts/ajv-validator.js:3157–3171  ·  view source on GitHub ↗
(valid = codegen_1.nil, $dataValid = codegen_1.nil)

Source from the content-addressed store, hash-verified

3155 });
3156 }
3157 check$data(valid = codegen_1.nil, $dataValid = codegen_1.nil) {
3158 if (!this.$data)
3159 return;
3160 const { gen, schemaCode, schemaType, def } = this;
3161 gen.if((0, codegen_1.or)((0, codegen_1._) `${schemaCode} === undefined`, $dataValid));
3162 if (valid !== codegen_1.nil)
3163 gen.assign(valid, true);
3164 if (schemaType.length || def.validateSchema) {
3165 gen.elseIf(this.invalid$data());
3166 this.$dataError();
3167 if (valid !== codegen_1.nil)
3168 gen.assign(valid, false);
3169 }
3170 gen.else();
3171 }
3172 invalid$data() {
3173 const { gen, schemaCode, schemaType, def, it } = this;
3174 return (0, codegen_1.or)(wrong$DataType(), invalid$DataSchema());

Callers 1

block$dataMethod · 0.95

Calls 6

invalid$dataMethod · 0.95
$dataErrorMethod · 0.95
assignMethod · 0.80
elseIfMethod · 0.80
elseMethod · 0.80
ifMethod · 0.45

Tested by

no test coverage detected