UNPKG

756 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const util_1 = require("../../compile/util");
4const 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};
22exports.default = def;
23//# sourceMappingURL=allOf.js.map
\No newline at end of file