Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ajv.js 839B

123456789101112131415161718192021222324252627282930
  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. schemaId: "auto"
  20. });
  21. ajv.addMetaSchema(metaSchema);
  22. // eslint-disable-next-line no-underscore-dangle
  23. ajv._opts.defaultMeta = metaSchema.id;
  24. module.exports = ajv;