source: trip-planner-front/node_modules/ajv/dist/jtd.js@ 6fe77af

Last change on this file since 6fe77af was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 2.8 KB
Line 
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0;
4const core_1 = require("./core");
5const jtd_1 = require("./vocabularies/jtd");
6const jtd_schema_1 = require("./refs/jtd-schema");
7const serialize_1 = require("./compile/jtd/serialize");
8const parse_1 = require("./compile/jtd/parse");
9const META_SCHEMA_ID = "JTD-meta-schema";
10class Ajv extends core_1.default {
11 constructor(opts = {}) {
12 super({
13 ...opts,
14 jtd: true,
15 });
16 }
17 _addVocabularies() {
18 super._addVocabularies();
19 this.addVocabulary(jtd_1.default);
20 }
21 _addDefaultMetaSchema() {
22 super._addDefaultMetaSchema();
23 if (!this.opts.meta)
24 return;
25 this.addMetaSchema(jtd_schema_1.default, META_SCHEMA_ID, false);
26 }
27 defaultMeta() {
28 return (this.opts.defaultMeta =
29 super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined));
30 }
31 compileSerializer(schema) {
32 const sch = this._addSchema(schema);
33 return sch.serialize || this._compileSerializer(sch);
34 }
35 compileParser(schema) {
36 const sch = this._addSchema(schema);
37 return (sch.parse || this._compileParser(sch));
38 }
39 _compileSerializer(sch) {
40 serialize_1.default.call(this, sch, sch.schema.definitions || {});
41 /* istanbul ignore if */
42 if (!sch.serialize)
43 throw new Error("ajv implementation error");
44 return sch.serialize;
45 }
46 _compileParser(sch) {
47 parse_1.default.call(this, sch, sch.schema.definitions || {});
48 /* istanbul ignore if */
49 if (!sch.parse)
50 throw new Error("ajv implementation error");
51 return sch.parse;
52 }
53}
54module.exports = exports = Ajv;
55Object.defineProperty(exports, "__esModule", { value: true });
56exports.default = Ajv;
57var validate_1 = require("./compile/validate");
58Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function () { return validate_1.KeywordCxt; } });
59var codegen_1 = require("./compile/codegen");
60Object.defineProperty(exports, "_", { enumerable: true, get: function () { return codegen_1._; } });
61Object.defineProperty(exports, "str", { enumerable: true, get: function () { return codegen_1.str; } });
62Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return codegen_1.stringify; } });
63Object.defineProperty(exports, "nil", { enumerable: true, get: function () { return codegen_1.nil; } });
64Object.defineProperty(exports, "Name", { enumerable: true, get: function () { return codegen_1.Name; } });
65Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function () { return codegen_1.CodeGen; } });
66//# sourceMappingURL=jtd.js.map
Note: See TracBrowser for help on using the repository browser.