[6a3a178] | 1 | "use strict";
|
---|
| 2 | Object.defineProperty(exports, "__esModule", { value: true });
|
---|
| 3 | exports.CodeGen = exports.Name = exports.nil = exports.stringify = exports.str = exports._ = exports.KeywordCxt = void 0;
|
---|
| 4 | const core_1 = require("./core");
|
---|
| 5 | const draft7_1 = require("./vocabularies/draft7");
|
---|
| 6 | const dynamic_1 = require("./vocabularies/dynamic");
|
---|
| 7 | const next_1 = require("./vocabularies/next");
|
---|
| 8 | const unevaluated_1 = require("./vocabularies/unevaluated");
|
---|
| 9 | const discriminator_1 = require("./vocabularies/discriminator");
|
---|
| 10 | const json_schema_2019_09_1 = require("./refs/json-schema-2019-09");
|
---|
| 11 | const META_SCHEMA_ID = "https://json-schema.org/draft/2019-09/schema";
|
---|
| 12 | class Ajv2019 extends core_1.default {
|
---|
| 13 | constructor(opts = {}) {
|
---|
| 14 | super({
|
---|
| 15 | ...opts,
|
---|
| 16 | dynamicRef: true,
|
---|
| 17 | next: true,
|
---|
| 18 | unevaluated: true,
|
---|
| 19 | });
|
---|
| 20 | }
|
---|
| 21 | _addVocabularies() {
|
---|
| 22 | super._addVocabularies();
|
---|
| 23 | this.addVocabulary(dynamic_1.default);
|
---|
| 24 | draft7_1.default.forEach((v) => this.addVocabulary(v));
|
---|
| 25 | this.addVocabulary(next_1.default);
|
---|
| 26 | this.addVocabulary(unevaluated_1.default);
|
---|
| 27 | if (this.opts.discriminator)
|
---|
| 28 | this.addKeyword(discriminator_1.default);
|
---|
| 29 | }
|
---|
| 30 | _addDefaultMetaSchema() {
|
---|
| 31 | super._addDefaultMetaSchema();
|
---|
| 32 | const { $data, meta } = this.opts;
|
---|
| 33 | if (!meta)
|
---|
| 34 | return;
|
---|
| 35 | json_schema_2019_09_1.default.call(this, $data);
|
---|
| 36 | this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID;
|
---|
| 37 | }
|
---|
| 38 | defaultMeta() {
|
---|
| 39 | return (this.opts.defaultMeta =
|
---|
| 40 | super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined));
|
---|
| 41 | }
|
---|
| 42 | }
|
---|
| 43 | module.exports = exports = Ajv2019;
|
---|
| 44 | Object.defineProperty(exports, "__esModule", { value: true });
|
---|
| 45 | exports.default = Ajv2019;
|
---|
| 46 | var validate_1 = require("./compile/validate");
|
---|
| 47 | Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function () { return validate_1.KeywordCxt; } });
|
---|
| 48 | var codegen_1 = require("./compile/codegen");
|
---|
| 49 | Object.defineProperty(exports, "_", { enumerable: true, get: function () { return codegen_1._; } });
|
---|
| 50 | Object.defineProperty(exports, "str", { enumerable: true, get: function () { return codegen_1.str; } });
|
---|
| 51 | Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return codegen_1.stringify; } });
|
---|
| 52 | Object.defineProperty(exports, "nil", { enumerable: true, get: function () { return codegen_1.nil; } });
|
---|
| 53 | Object.defineProperty(exports, "Name", { enumerable: true, get: function () { return codegen_1.Name; } });
|
---|
| 54 | Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function () { return codegen_1.CodeGen; } });
|
---|
| 55 | //# sourceMappingURL=2019.js.map |
---|