main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
1.0 KB
|
Rev | Line | |
---|
[79a0317] | 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 } }) => (0, codegen_1.str) `must NOT have more than ${len} items`,
|
---|
| 9 | params: ({ params: { len } }) => (0, 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 ((0, util_1.alwaysValidSchema)(it, schema))
|
---|
| 22 | return;
|
---|
| 23 | if (prefixItems)
|
---|
| 24 | (0, additionalItems_1.validateAdditionalItems)(cxt, prefixItems);
|
---|
| 25 | else
|
---|
| 26 | cxt.ok((0, 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.