ajv.js 817 B

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