(key)
| 4507 | gen.code((0, codegen_1._) `delete ${data}[${key}]`); |
| 4508 | } |
| 4509 | function additionalPropertyCode(key) { |
| 4510 | if (opts.removeAdditional === "all" || (opts.removeAdditional && schema === false)) { |
| 4511 | deleteAdditional(key); |
| 4512 | return; |
| 4513 | } |
| 4514 | if (schema === false) { |
| 4515 | cxt.setParams({ additionalProperty: key }); |
| 4516 | cxt.error(); |
| 4517 | if (!allErrors) |
| 4518 | gen.break(); |
| 4519 | return; |
| 4520 | } |
| 4521 | if (typeof schema == "object" && !(0, util_1.alwaysValidSchema)(it, schema)) { |
| 4522 | const valid = gen.name("valid"); |
| 4523 | if (opts.removeAdditional === "failing") { |
| 4524 | applyAdditionalSchema(key, valid, false); |
| 4525 | gen.if((0, codegen_1.not)(valid), () => { |
| 4526 | cxt.reset(); |
| 4527 | deleteAdditional(key); |
| 4528 | }); |
| 4529 | } |
| 4530 | else { |
| 4531 | applyAdditionalSchema(key, valid); |
| 4532 | if (!allErrors) |
| 4533 | gen.if((0, codegen_1.not)(valid), () => gen.break()); |
| 4534 | } |
| 4535 | } |
| 4536 | } |
| 4537 | function applyAdditionalSchema(key, valid, errors) { |
| 4538 | const subschema = { |
| 4539 | keyword: "additionalProperties", |
no test coverage detected