source: trip-planner-front/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js

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: 1.2 KB
Line 
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const codegen_1 = require("../../compile/codegen");
4const util_1 = require("../../compile/util");
5const error = {
6 message: "property name must be valid",
7 params: ({ params }) => codegen_1._ `{propertyName: ${params.propertyName}}`,
8};
9const def = {
10 keyword: "propertyNames",
11 type: "object",
12 schemaType: ["object", "boolean"],
13 error,
14 code(cxt) {
15 const { gen, schema, data, it } = cxt;
16 if (util_1.alwaysValidSchema(it, schema))
17 return;
18 const valid = gen.name("valid");
19 gen.forIn("key", data, (key) => {
20 cxt.setParams({ propertyName: key });
21 cxt.subschema({
22 keyword: "propertyNames",
23 data: key,
24 dataTypes: ["string"],
25 propertyName: key,
26 compositeRule: true,
27 }, valid);
28 gen.if(codegen_1.not(valid), () => {
29 cxt.error(true);
30 if (!it.allErrors)
31 gen.break();
32 });
33 });
34 cxt.ok(valid);
35 },
36};
37exports.default = def;
38//# sourceMappingURL=propertyNames.js.map
Note: See TracBrowser for help on using the repository browser.