source: trip-planner-front/node_modules/ajv/dist/vocabularies/jtd/metadata.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: 805 bytes
Line 
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.checkMetadata = void 0;
4const util_1 = require("../../compile/util");
5const def = {
6 keyword: "metadata",
7 schemaType: "object",
8 code(cxt) {
9 checkMetadata(cxt);
10 const { gen, schema, it } = cxt;
11 if (util_1.alwaysValidSchema(it, schema))
12 return;
13 const valid = gen.name("valid");
14 cxt.subschema({ keyword: "metadata", jtdMetadata: true }, valid);
15 cxt.ok(valid);
16 },
17};
18function checkMetadata({ it, keyword }, metadata) {
19 if (it.jtdMetadata !== metadata) {
20 throw new Error(`JTD: "${keyword}" cannot be used in this schema location`);
21 }
22}
23exports.checkMetadata = checkMetadata;
24exports.default = def;
25//# sourceMappingURL=metadata.js.map
Note: See TracBrowser for help on using the repository browser.