source: imaps-frontend/node_modules/ajv/dist/vocabularies/validation/limitProperties.js@ 79a0317

main
Last change on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 896 bytes
Line 
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const codegen_1 = require("../../compile/codegen");
4const error = {
5 message({ keyword, schemaCode }) {
6 const comp = keyword === "maxProperties" ? "more" : "fewer";
7 return (0, codegen_1.str) `must NOT have ${comp} than ${schemaCode} properties`;
8 },
9 params: ({ schemaCode }) => (0, codegen_1._) `{limit: ${schemaCode}}`,
10};
11const def = {
12 keyword: ["maxProperties", "minProperties"],
13 type: "object",
14 schemaType: "number",
15 $data: true,
16 error,
17 code(cxt) {
18 const { keyword, data, schemaCode } = cxt;
19 const op = keyword === "maxProperties" ? codegen_1.operators.GT : codegen_1.operators.LT;
20 cxt.fail$data((0, codegen_1._) `Object.keys(${data}).length ${op} ${schemaCode}`);
21 },
22};
23exports.default = def;
24//# sourceMappingURL=limitProperties.js.map
Note: See TracBrowser for help on using the repository browser.