patternRequired.js 412 B

123456789101112131415161718192021
  1. 'use strict';
  2. module.exports = function defFunc(ajv) {
  3. defFunc.definition = {
  4. type: 'object',
  5. inline: require('./dotjs/patternRequired'),
  6. statements: true,
  7. errors: 'full',
  8. metaSchema: {
  9. type: 'array',
  10. items: {
  11. type: 'string',
  12. format: 'regex'
  13. },
  14. uniqueItems: true
  15. }
  16. };
  17. ajv.addKeyword('patternRequired', defFunc.definition);
  18. return ajv;
  19. };