[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 discriminator_1 = require("./vocabularies/discriminator");
|
---|
| 7 | const draft7MetaSchema = require("./refs/json-schema-draft-07.json");
|
---|
| 8 | const META_SUPPORT_DATA = ["/properties"];
|
---|
| 9 | const META_SCHEMA_ID = "http://json-schema.org/draft-07/schema";
|
---|
| 10 | class Ajv extends core_1.default {
|
---|
| 11 | _addVocabularies() {
|
---|
| 12 | super._addVocabularies();
|
---|
| 13 | draft7_1.default.forEach((v) => this.addVocabulary(v));
|
---|
| 14 | if (this.opts.discriminator)
|
---|
| 15 | this.addKeyword(discriminator_1.default);
|
---|
| 16 | }
|
---|
| 17 | _addDefaultMetaSchema() {
|
---|
| 18 | super._addDefaultMetaSchema();
|
---|
| 19 | if (!this.opts.meta)
|
---|
| 20 | return;
|
---|
| 21 | const metaSchema = this.opts.$data
|
---|
| 22 | ? this.$dataMetaSchema(draft7MetaSchema, META_SUPPORT_DATA)
|
---|
| 23 | : draft7MetaSchema;
|
---|
| 24 | this.addMetaSchema(metaSchema, META_SCHEMA_ID, false);
|
---|
| 25 | this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID;
|
---|
| 26 | }
|
---|
| 27 | defaultMeta() {
|
---|
| 28 | return (this.opts.defaultMeta =
|
---|
| 29 | super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined));
|
---|
| 30 | }
|
---|
| 31 | }
|
---|
| 32 | module.exports = exports = Ajv;
|
---|
| 33 | Object.defineProperty(exports, "__esModule", { value: true });
|
---|
| 34 | exports.default = Ajv;
|
---|
| 35 | var validate_1 = require("./compile/validate");
|
---|
| 36 | Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function () { return validate_1.KeywordCxt; } });
|
---|
| 37 | var codegen_1 = require("./compile/codegen");
|
---|
| 38 | Object.defineProperty(exports, "_", { enumerable: true, get: function () { return codegen_1._; } });
|
---|
| 39 | Object.defineProperty(exports, "str", { enumerable: true, get: function () { return codegen_1.str; } });
|
---|
| 40 | Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return codegen_1.stringify; } });
|
---|
| 41 | Object.defineProperty(exports, "nil", { enumerable: true, get: function () { return codegen_1.nil; } });
|
---|
| 42 | Object.defineProperty(exports, "Name", { enumerable: true, get: function () { return codegen_1.Name; } });
|
---|
| 43 | Object.defineProperty(exports, "CodeGen", { enumerable: true, get: function () { return codegen_1.CodeGen; } });
|
---|
| 44 | //# sourceMappingURL=ajv.js.map |
---|