MCPcopy Create free account
hub / github.com/json-editor/json-editor / checkReportMissingProp

Function checkReportMissingProp

docs/scripts/ajv-validator.js:5446–5452  ·  view source on GitHub ↗
(cxt, prop)

Source from the content-addressed store, hash-verified

5444 const names_1 = __webpack_require__(/*! ../compile/names */ "./node_modules/ajv/dist/compile/names.js");
5445 const util_2 = __webpack_require__(/*! ../compile/util */ "./node_modules/ajv/dist/compile/util.js");
5446 function checkReportMissingProp(cxt, prop) {
5447 const { gen, data, it } = cxt;
5448 gen.if(noPropertyInData(gen, data, prop, it.opts.ownProperties), () => {
5449 cxt.setParams({ missingProperty: (0, codegen_1._) `${prop}` }, true);
5450 cxt.error();
5451 });
5452 }
5453 exports.checkReportMissingProp = checkReportMissingProp;
5454 function checkMissingProp({ gen, data, it: { opts } }, properties, missing) {
5455 return (0, codegen_1.or)(...properties.map((prop) => (0, codegen_1.and)(noPropertyInData(gen, data, prop, opts.ownProperties), (0, codegen_1._) `${missing} = ${prop}`)));

Callers

nothing calls this directly

Calls 4

noPropertyInDataFunction · 0.85
setParamsMethod · 0.80
errorMethod · 0.80
ifMethod · 0.45

Tested by

no test coverage detected