Last change
on this file 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";
|
---|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
---|
3 | const codegen_1 = require("../../compile/codegen");
|
---|
4 | const util_1 = require("../../compile/util");
|
---|
5 | const code_1 = require("../code");
|
---|
6 | const additionalItems_1 = require("./additionalItems");
|
---|
7 | const error = {
|
---|
8 | message: ({ params: { len } }) => codegen_1.str `must NOT have more than ${len} items`,
|
---|
9 | params: ({ params: { len } }) => codegen_1._ `{limit: ${len}}`,
|
---|
10 | };
|
---|
11 | const 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 | };
|
---|
29 | exports.default = def;
|
---|
30 | //# sourceMappingURL=items2020.js.map |
---|
Note:
See
TracBrowser
for help on using the repository browser.