(cxt, def)
| 3297 | const code_1 = __webpack_require__(/*! ../../vocabularies/code */ "./node_modules/ajv/dist/vocabularies/code.js"); |
| 3298 | const errors_1 = __webpack_require__(/*! ../errors */ "./node_modules/ajv/dist/compile/errors.js"); |
| 3299 | function macroKeywordCode(cxt, def) { |
| 3300 | const { gen, keyword, schema, parentSchema, it } = cxt; |
| 3301 | const macroSchema = def.macro.call(it.self, schema, parentSchema, it); |
| 3302 | const schemaRef = useKeyword(gen, keyword, macroSchema); |
| 3303 | if (it.opts.validateSchema !== false) |
| 3304 | it.self.validateSchema(macroSchema, true); |
| 3305 | const valid = gen.name("valid"); |
| 3306 | cxt.subschema({ |
| 3307 | schema: macroSchema, |
| 3308 | schemaPath: codegen_1.nil, |
| 3309 | errSchemaPath: `${it.errSchemaPath}/${keyword}`, |
| 3310 | topSchemaRef: schemaRef, |
| 3311 | compositeRule: true, |
| 3312 | }, valid); |
| 3313 | cxt.pass(valid, () => cxt.error(true)); |
| 3314 | } |
| 3315 | exports.macroKeywordCode = macroKeywordCode; |
| 3316 | function funcKeywordCode(cxt, def) { |
| 3317 | var _a; |
nothing calls this directly
no test coverage detected