source: trip-planner-front/node_modules/ajv/dist/vocabularies/applicator/items2020.js@ eed0bf8

Last change on this file since eed0bf8 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1012 bytes
Line 
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const codegen_1 = require("../../compile/codegen");
4const util_1 = require("../../compile/util");
5const code_1 = require("../code");
6const additionalItems_1 = require("./additionalItems");
7const error = {
8 message: ({ params: { len } }) => codegen_1.str `must NOT have more than ${len} items`,
9 params: ({ params: { len } }) => codegen_1._ `{limit: ${len}}`,
10};
11const def = {
12 keyword: "items",
13 type: "array",
14 schemaType: ["object", "boolean"],
15 before: "uniqueItems",
16 error,
17 code(cxt) {
18 const { schema, parentSchema, it } = cxt;
19 const { prefixItems } = parentSchema;
20 it.items = true;
21 if (util_1.alwaysValidSchema(it, schema))
22 return;
23 if (prefixItems)
24 additionalItems_1.validateAdditionalItems(cxt, prefixItems);
25 else
26 cxt.ok(code_1.validateArray(cxt));
27 },
28};
29exports.default = def;
30//# sourceMappingURL=items2020.js.map
Note: See TracBrowser for help on using the repository browser.