allOf.js 756 B

1234567891011121314151617181920212223
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. const util_1 = require("../../compile/util");
  4. const def = {
  5. keyword: "allOf",
  6. schemaType: "array",
  7. code(cxt) {
  8. const { gen, schema, it } = cxt;
  9. /* istanbul ignore if */
  10. if (!Array.isArray(schema))
  11. throw new Error("ajv implementation error");
  12. const valid = gen.name("valid");
  13. schema.forEach((sch, i) => {
  14. if ((0, util_1.alwaysValidSchema)(it, sch))
  15. return;
  16. const schCxt = cxt.subschema({ keyword: "allOf", schemaProp: i }, valid);
  17. cxt.ok(valid);
  18. cxt.mergeEvaluated(schCxt);
  19. });
  20. },
  21. };
  22. exports.default = def;
  23. //# sourceMappingURL=allOf.js.map