UNPKG

817 BJavaScriptView Raw
1/**
2 * @fileoverview The instance of Ajv validator.
3 * @author Evgeny Poberezkin
4 */
5"use strict";
6
7//------------------------------------------------------------------------------
8// Requirements
9//------------------------------------------------------------------------------
10
11const Ajv = require("ajv"),
12 metaSchema = require("ajv/lib/refs/json-schema-draft-04.json");
13
14//------------------------------------------------------------------------------
15// Public Interface
16//------------------------------------------------------------------------------
17
18const ajv = new Ajv({
19 meta: false,
20 validateSchema: false,
21 missingRefs: "ignore",
22 verbose: true
23});
24
25ajv.addMetaSchema(metaSchema);
26// eslint-disable-next-line no-underscore-dangle
27ajv._opts.defaultMeta = metaSchema.id;
28
29module.exports = ajv;