()
| 5794 | gen.if((0, codegen_1._) `typeof ${tag} == "string"`, () => validateMapping(), () => cxt.error(false, { discrError: types_1.DiscrError.Tag, tag, tagName })); |
| 5795 | cxt.ok(valid); |
| 5796 | function validateMapping() { |
| 5797 | const mapping = getMapping(); |
| 5798 | gen.if(false); |
| 5799 | for (const tagValue in mapping) { |
| 5800 | gen.elseIf((0, codegen_1._) `${tag} === ${tagValue}`); |
| 5801 | gen.assign(valid, applyTagSchema(mapping[tagValue])); |
| 5802 | } |
| 5803 | gen.else(); |
| 5804 | cxt.error(false, { discrError: types_1.DiscrError.Mapping, tag, tagName }); |
| 5805 | gen.endIf(); |
| 5806 | } |
| 5807 | function applyTagSchema(schemaProp) { |
| 5808 | const _valid = gen.name("valid"); |
| 5809 | const schCxt = cxt.subschema({ keyword: "oneOf", schemaProp }, _valid); |
no test coverage detected